Faker

Generate massive amounts of realistic fake data for testing, seeding, and mocking in JavaScript and TypeScript.

Library
npm
v10.6.0
15,528 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 100
Maintenance 100
Community 68
Maturity 56
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
84 /100 Excellent
Architecture 88
Code Quality 92
Innovation 65
Learning Curve 90

Faker is a zero-dependency JavaScript and TypeScript library for generating large volumes of realistic-looking fake data. It exposes dozens of topic-scoped modules — person, location, commerce, finance, internet, date, and more — so instead of hand-writing placeholder values, developers call typed methods like faker.person.firstName() or faker.internet.email() to produce data that looks real without being real.

The library is organized around per-topic modules (currently 24+ covering airline, animal, book, color, commerce, company, database, date, finance, food, git, hacker, image, internet, location, lorem, medical, music, person, phone, science, system, vehicle, and word data) and supports over 70 locales, so generated names, addresses, and phone numbers can be localized instead of defaulting to generic English placeholders.

Faker is commonly used to seed development databases, generate mock API responses, and populate test fixtures, and its deterministic seeding (faker.seed()) lets teams reproduce the exact same ‘random’ dataset across test runs. The project was revived by the community after the original faker.js was deliberately corrupted by its maintainer in January 2022, and is now maintained under the faker-js organization with an active release cadence and a large contributor base.

What You Get

  • 24+ topic modules (person, location, commerce, finance, internet, date, git, hacker, image, music, phone, science, vehicle, word, and more) covering the vast majority of fake-data needs out of the box
  • 70+ locale data sets, with instance-level locale selection and configurable fallback so localized names, addresses, and phone numbers don’t default to English
  • Deterministic seeding via faker.seed() for reproducible datasets across test runs and CI environments
  • A zero-runtime-dependency, fully typed (TypeScript-first) API with tree-shakeable ESM exports for smaller bundle sizes when only specific modules or locales are imported
  • A template helper (faker.helpers.fake) for combining multiple generator calls into a single mustache-style string
  • A SimpleFaker base class and a full Faker class, letting consumers build custom locale-scoped instances rather than only using the default shared instance

Common Use Cases

  • Seeding local or staging databases with realistic-looking sample data during development
  • Generating mock API response payloads for frontend development before a backend endpoint exists
  • Populating fixtures and factories in unit/integration test suites (e.g. with vitest, jest, or factory libraries)
  • Producing consistent, seeded synthetic datasets for demos, load testing, or documentation examples
  • Building localized test data (names, addresses, phone formats) for internationalized applications

Under The Hood

Architecture

Faker’s core class hierarchy runs SimpleFaker (src/simple-faker.ts) as the base random/seed engine, extended by the full Faker class (src/faker.ts) which composes 24+ per-topic modules (AirlineModule, PersonModule, InternetModule, etc., under src/modules/) as readonly instance properties. Each module is a self-contained class exported from its own index.ts/module.ts, so adding or modifying a data domain doesn’t touch the core engine. Locale data lives separately under src/locales/ (78 locale directories) and src/locale/, decoupled from module logic via a LocaleProxy internal layer, so the same module code can serve any locale’s dataset. This module-per-topic, locale-as-data separation means the core abstraction that would break the most if changed is the Faker/SimpleFaker constructor contract, since every module depends on it for seeded randomness.

Tech Stack

The project is 100% TypeScript, built with tsdown for the distributable ESM output and tsc for type-checking, inside a pnpm workspace (pnpm-workspace.yaml). It ships as type: module with zero runtime dependencies in package.json — only devDependencies (27 entries) for tooling. Linting and formatting use oxlint/oxfmt (Rust-based, faster alternatives to ESLint/Prettier) rather than the more common JS toolchain. Documentation is built with VitePress (docs/ directory), and release automation runs through commit-and-tag-version.

Code Quality

The test/ directory mirrors src/modules/ one-to-one, using Vitest with a shared seededTests helper (test/support/seeded-runs.ts) that runs each generator method with a fixed seed and asserts against stored snapshots (test/snapshots/), catching any unintended change in output distribution. Coverage is collected via the v8 provider across clover/cobertura/lcov/text reporters. GitHub Actions (.github/workflows/ci.yml, integration-test.yml, pr.yml) run lint, type-check, unit tests, and a separate integration-test pass. The combination of per-module seeded snapshot tests plus full TypeScript typing gives strong confidence that a change to one module’s output is caught immediately.

API Design The public API favors flat, discoverable namespacing (faker.person.firstName(), faker.internet.email()) over deeply nested configuration objects, so autocomplete alone documents most of the surface area. Locale switching is done by importing a differently-named export (fakerDE, fakerJA) or constructing a custom new Faker({ locale: [...] }) instance rather than passing a locale string at call time, which trades a small amount of runtime flexibility for compile-time tree-shaking of unused locale data. A single template helper (faker.helpers.fake) covers the common case of composing multiple fields into one string, avoiding the need for consumers to hand-write string interpolation across several module calls.

Used by 60 apps in this directory

TypeScript
62%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,978

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 62%
Svelte 34%
Updated 1 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
71%
Other

LogChimp

Marketing · Product Management

1,132

Collect customer feedback, prioritize features with upvotes, and build transparent product roadmaps — fully self-hosted and open source.

View details
83
Repo Health
77
Technical
72
Dependency
Built with
TypeScript 71%
Vue 27%
Updated 1 weeks ago
TypeScript
81%
AGPL 3.0

massCode

Code Editors · Developer Tools · Productivity

7,085

A free, local-first developer workspace unifying snippets, notes, HTTP requests, calculations, drawings, and dev tools in one desktop app.

View details
85
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 81%
Vue 17%
Updated 2 weeks ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
87%
MIT

medusa

Ecommerce

36,897

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
94
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 1 weeks ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers