node-random-json

0.0.1 • Public • Published

node-random-js

generate random json objects

install

  npm install node-random-js

or

  yarn add node-random-js

quick start

  const generateRandomJson = require('node-random-json')({});
 
  console.log(generateRandomJson('Object'));

config options

  const generateRandomJson = require('node-random-json')({
    chars: [ LIST_OF_CHARS_TO_USE_IN_RANDOM_STRINGS ],
    // default: [ 'a', 'b', ..., 'z', 'A', 'B', ..., 'Z', '0', '1', ..., '9', '.', '-', ' ' ]
    types: [ LIST_OF_TYPES_TO_GENERATE_IN_JSON ],
    // default: ['Object', 'Array', 'Date', 'String', 'Number', 'Boolean', 'Null', 'Undefined', 'Function']
    maxDepth: MAXIMUM_OBJECT_DEPTH,
    // default: 10
    minStrLen: MINIMUM_STRING_LENGTH,
    // default: 5
    maxStrLen: MAXIMUM_STRING_LENGTH,
    // default: 20
    minArraySize: MINIMUM_ARRAY_SIZE,
    // default: 0
    maxArraySize: MAXIMUM_ARRAY_SIZE,
    //default: 20
    minObjectSize: MINIMUM_OBJECT_SIZE,
    // default: 0
    maxObjectSize: MAXIMUM_OBJECT_SIZE,
    // default: 20
    maxAbsNumber: MAXIMUM_ABSOLUTE_NUMBER
    // default: 2000000
  });
 
  console.log(generateRandomJson('Object'));
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    2
  • 0.0.0
    0

Package Sidebar

Install

npm i node-random-json

Weekly Downloads

2

Version

0.0.1

License

BSD

Unpacked Size

3.44 kB

Total Files

3

Last publish

Collaborators

  • 4dr144n