Skip to content

tacitknowledge/json-data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-data-generator

random JSON data generator from a template JSON file.

Uses Faker.js (https://github.com/Marak/faker.js) to generate mock data.

Usage

  1. Install Node and NPM
  2. run npm install
  3. run node generate.js sample.json.template [-o outputfile] [-c collectionSize ]

Template Syntax

  1. Anything wrapped in ${ ... } will be evaluated. Works with any javascript syntax
  2. To use Faker API, use ${ faker. ...}. See http://marak.github.io/faker.js/index.html for available faker documentation
  3. You can specify random number of elements in an array by using the following syntax as the property name: <property name>__$repeat_<min>_<max>. See sample.json.template
  4. If -c is specified, it will create a collection of the template objects

To Do

  1. Template syntax validations
  2. Write tests

About

random JSON data generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published