faker.js is a tool to generate fake data in Node.js and in the browser, it has a lot of different data types to enable you to generate very customised and complete sets of fake or mock data for testing purposes.
It also supports multiple languages and locales and can generate a lot of data types to fit your use case.
Data Types
- address
- commerce
- company
- database
- date
- finance
- hacker
- helpers
- image
- internet
- lorem
- name
- phone
- random
- system
Usage
Browser
1 2 3 4 5 6 |
<script src = "faker.js" type = "text/javascript"></script> <script> var randomName = faker.name.findName(); // Caitlyn Kerluke var randomCard = faker.helpers.createCard(); // random contact card containing many properties </script> |
Node.js
1 2 3 4 5 |
var faker = require('faker'); var randomName = faker.name.findName(); // Rowan Nikolaus var randomCard = faker.helpers.createCard(); // random contact card containing many properties |
You can download faker.js here:
Or read more here.