DEV Community

Graham Sutton
Graham Sutton

Posted on • Edited on

Laravel's factory method, but for JavaScript.

When I became exhausted with trying to create tons of mock API data on the fly for my Node projects, I created a simple little script that would let me define the skeleton of the JSON structure I wanted without having to copy, paste, and modify each individual record.

This script is now available as an NPM package that does almost exactly what Laravel's factory method does except for JavaScript. It's lightweight and great for stubbing APIs in your Vue and React projects, too!

Link to the repo: https://github.com/grahamsutton/factory

Top comments (0)