Need A Lot Of Fake Data, Real Quick?
Say no more, for faker.js has you covered!
Faker.js is fake data generator implemented for nodejs and the browser. From zip codes to avatars to account names to hacker phrases, faker.js comes equipped with a huge dataset.
<!-- Just link to faker.js in your html through their CDN -->
<!-- or your local download -->
Install the dependency into your directory:
npm install -S faker
Then create an index.js and inside require faker:
const faker = require(‘faker’);
and using curl:
How To Use
Once you have faker installed, you will have access to the faker object. This object is filled with subcategories of data (address, company, database, date, hacker, image, internet, name, phone, random…).
Each subcategory has a set of methods that, when called, will return some data based on method called.
You can even change the localization by changing faker.locale (the default is english)
faker.local = “fr”; // language is set to French
faker.local = "es"; // language is set to Spanish
Receiving from the API is just as easy!