How to Generate fake data using Faker module in Node.js ?
Faker module is used to generate fake data, not only fake data, infect well organized fake data. Faker module is a widely used NPM module that can generate fake names, addresses, product names, prices with all these you can also generate fake IP addresses, images, and much more using this faker package.
Command to install faker module:
npm install faker
There are some predefined context for which fake data are created for a particular context as mentioned below:
Context(object) Aspect(method) name firstName, lastName, findName, suffix, jobTitle, jobDiscriptor address latitude, longitude, country, state, city, zipCode, streetName commerce product, productName, price, productMaterial finance account, accountName, amount, currencyName, currencyCode, transactionType image people, nature, sports, animals, fashion, food, nightLife internet email, url, ip, mac, password, domainName
Syntax to get fake data
Reference: NPM faker package