builder-faker
v1.0.9
Published
Create a mock with faker
Downloads
15
Maintainers
Readme
Builder-Faker
Based on faker , allow you to build array of object by passing only keys in values
Installation
npm i builder-faker
Import
import BuilderFaker from "builder-faker/builder";
How to use it?
const yourBuilder=new BuilderFaker(numberOfObjects,arrayOfKeys);
//get your array
yourBuilder.object;
//exemple
const builder=new BuilderFaker(5,["id","name","email","this arg doesn't exist","snake","firstName","fish"]);
console.log(builder.object);
The class will search some methods what matches with the keys passed. If the key doesn't exist, it will take a random word
Tips
yourBuilder.savedMethods
saveMethods return an array of each methods used for each key