[Node pkg]: Generate Random Data with Faker
Node.js
10/01/2019
Faker documentation (Node.js)
Installation
Use Node Package Manager to install Faker
BASH
$ npm install faker
Usage Example
main.js
JS
var faker = require('faker'); // import packagefor(i = 0; i < 20; i ++){ var randEmail = faker.internet.email(); console.log(randEmail);}
TEXT
Returns random 20 emails
Random date
JS
var faker = require('faker');console.log( faker.date.past() );
TEXT
2018-10-14T17:35:04.919Z
Random Address
JS
var faker = require('faker');console.log(faker.address.streetAddress());console.log(faker.address.city());console.log(faker.address.state() + ', ' + faker.address.zipCode());
TEXT
3982 Nitzsche ViaBednarburyNorth Dakota, 21930