random JSON data generator from a template JSON file.
Uses Faker.js (https://github.com/Marak/faker.js) to generate mock data.
- Install Node and NPM
- run
npm install
- run
node generate.js sample.json.template [-o outputfile] [-c collectionSize ]
- Anything wrapped in
${ ... }
will be evaluated. Works with any javascript syntax - To use Faker API, use
${ faker. ...}
. See http://marak.github.io/faker.js/index.html for available faker documentation - You can specify random number of elements in an array by using the following syntax as the property name:
<property name>__$repeat_<min>_<max>
. Seesample.json.template
- If -c is specified, it will create a collection of the template objects
- Template syntax validations
- Write tests