🧪
Testing5M+/wkMIT

@faker-js/faker

Faker is a library for generating massive amounts of realistic fake data for testing, development, and demonstration purposes. The community-maintained @faker-j

Installation

npm
npm install -D @faker-js/faker
yarn
yarn add -D @faker-js/faker
pnpm
pnpm add -D @faker-js/faker

Import

ESM
import { faker } from '@faker-js/faker';

Quick Example

usage
import { faker } from '@faker-js/faker';

const user = {
  name: faker.person.fullName(),
  email: faker.internet.email(),
  avatar: faker.image.avatar(),
  address: faker.location.streetAddress(),
};

console.log(user);

About @faker-js/faker

Faker is a library for generating massive amounts of realistic fake data for testing, development, and demonstration purposes. The community-maintained @faker-js/faker package (forked from the original faker.js after its controversial deletion) provides generators for names, addresses, phone numbers, emails, dates, commerce data, company information, finance details, images, lorem ipsum text, and dozens of other data categories. Faker supports locale-specific data generation for over 60 locales, producing culturally appropriate names, addresses, and phone number formats. The library provides both simple generators (faker.person.firstName()) and complex builders for creating realistic interconnected data objects. Faker includes a seeding system that produces deterministic output, allowing reproducible test data generation across test runs. Common use cases include populating development databases with realistic sample data, generating test fixtures for unit tests, creating demonstration data for prototypes and screenshots, and stress testing applications with large volumes of varied data. Faker integrates well with factory patterns and ORM seeders for generating complete object graphs with realistic relationships.

Quick Facts

Package@faker-js/faker
CategoryTesting
Weekly Downloads5M+
LicenseMIT
Installnpm install -D @faker-js/faker

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.