jenerator-js
v1.0.0
Published
A package to generate random instances of objects easily.
Downloads
2
Maintainers
Readme
jenerator-js
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