Fixture maker

fixture-maker

Fixture maker is an npm package that helps you create any amount of sample data in any shape you need.

The idea is that you can define the shape of an object that you need multiple copies of, with random data instead of flat, duplicate entries.

Quick usage example

const FixtureMaker = require("fixture-maker"); const fixtureMaker = new FixtureMaker(); const fixtureBody = { firstName: fixtureMaker.randomFirstName(), lastName: fixtureMaker.randomLastName(), age: fixtureMaker.randomNumber(), favouriteSnack: "Hummus", address: { lineOne: fixtureMaker.addressLineOne(), lineTwo: fixtureMaker.addressLineTwo(), postCode: fixtureMaker.postCode("GBR"), country: fixtureMaker.isoCountry(), }, }; fixtureMaker.make({ body: fixtureBody, numberOfCopies: 100, filename: "helloworld", });

fixture maker create a file called helloworld.json with 100 copies of the schema body you've specified.

NOTE: I am no longer actively working on this project as of January 2020.

The source code for this website can be found here under an MIT license