Skip to content

light-fakery

A lightweight JS library for generating fake data.

Write code like this:

typescript
import { randomInteger, randomPerson, times } from 'light-fakery'

const employees = times(100, (i) => ({
	detail: randomPerson(),
	id: i + 1,
	salary: randomInteger({ min: 50, max: 200 }) * 1000,
}))

...to produce data like this:

typescript
[
  {
    detail: {
      firstName: 'Ivan',
      lastName: 'Barros',
      fullName: 'Ivan Barros',
      emailAddress: 'ivan.barros@gmail.com',
    },
    id: 1,
    salary: 124000,
  },
  // ...and 99 more random employees!
]