oprogramador / json-schema-faker-cli

A CLI for json-schema-faker.
28 stars 12 forks source link

json-schema-faker-cli

MIT License Build Status

NPM status

This is a CLI for json-schema-faker.

install

npm install -g json-schema-faker-cli

usage

params

generating single object from the schema

generate-json schema.json output.json

generating array of multiple objects

generate-json schema.json output.json $ITEMS_LENGTH

generating with options set

generate-json schema.json output.json none options.js

You can use any of the json-schema-faker available options.

an example options file:

module.exports = {
  minLength: 20,
  random: () => 0.2,
};

generating to stdout

generate-json schema.json

skipping a param

You can pass none to skip any of the optional params. It's useful when you need to pass a following param when skipping some of the previous params at the same time.