jenerator-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

jenerator-js

Build Status Coverage Status

Creates random instances of objects.

Minimum and easy library to generate instances of objects in javascript. No dependencies. All

  • Supports the generation of objects with numeric and string values.
  • Supports the generation of constant fields.
  • Supportsd the random pick between a set of different items with randomFrom.

As simple as:

MockBuilder(10, {
    id: id(),
    a: randomNumber(0, 10000),
    b: {
      c: randomNumber(0, 300),
      d: randomString()
    },
    e: 4,
    f: null,
    g: randomFrom(["u", 6, "juja"])
  });

See working example in Codesandbox

For a more powerful library you can take a look into falso

Package Sidebar

Install

npm i jenerator-js

Weekly Downloads

26

Version

1.0.0

License

MIT

Unpacked Size

11.6 kB

Total Files

17

Last publish

Collaborators

  • pablovillacanhas