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
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
67%
MIT

Scalar

Developer Tools

16,313

Beautiful, interactive OpenAPI documentation with a built-in offline-first API client and multi-language code generation — all in one open-source platform.

View details
90
Repo Health
89
Technical
65
Dependency
Built with
TypeScript 67%
Vue 29%
Updated 6 days ago
TypeScript
96%
MIT

SplitPro

Invoicing Finance

1,474

Self-hosted, open source expense splitting with multi-currency, recurring bills, and bank imports — a complete Splitwise replacement you control.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 6 days ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
Rust
66%
Apache 2.0

Temps

Analytics · Devops · Monitoring

865

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
66
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 6 days ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 1 weeks 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