json-schema-faker-cli

5.0.6 • Public • Published

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

  • (required) file (path) containing JSON schema
  • (optional) generated file (path) according to the provided schema
  • (optional) number of objects in the array (when you want to generate an array of multiple objects matching the schema)
  • (optional) file (path) containing options (in JS or JSON format)

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.0.6767latest

Version History

VersionDownloads (Last 7 Days)Published
5.0.6767
5.0.50
5.0.40
5.0.30
5.0.20
5.0.10
5.0.00
4.0.00
3.0.70
3.0.60
3.0.50
3.0.40
3.0.30
3.0.20
3.0.10
3.0.00
2.1.20
2.1.10
2.1.00
2.0.100
2.0.90
2.0.80
2.0.70
2.0.60
2.0.50
2.0.45
2.0.33
2.0.20
2.0.10
2.0.00
1.2.00
1.1.00
1.0.00

Package Sidebar

Install

npm i json-schema-faker-cli

Weekly Downloads

594

Version

5.0.6

License

MIT

Unpacked Size

9.55 kB

Total Files

12

Last publish

Collaborators

  • oprogramador