ForgeData

v0.2.0 · 111+ generators · 100% test coverage

Fake data that feels real, ships light.

A modular, tree-shakable, zero-runtime-dependency fake data generator for TypeScript and JavaScript — a production-ready alternative to Faker.js, with React integration and a CLI built in.

|

npm install @sahinur/forgedata
Generators
0

Generators

Modules
0

Modules

Locales
0

Locales

Test coverage
0%

Test coverage

import { ForgeData } from "@sahinur/forgedata";

const forge = new ForgeData({ seed: 42 });

forge.person.fullName();          // "Ava Thompson"
forge.internet.email();           // "ava.thompson@example.com"
forge.finance.creditCardNumber(); // "4539123456781234"
forge.ai.prompt();                // "Explain quantum computing..."

Try it live

This runs the real, published @sahinur/forgedata package in your browser via esm.sh — nothing on this page is precomputed.

Output

Loading ForgeData in your browser…

 

Everything a modern test suite needs

Built from scratch as a clean-architecture alternative to Faker.js — not a fork.

111+ generators

16 modules — person, internet, finance, location, commerce, date, lorem, color, vehicle, ai, and more. Discoverable at runtime via forge.listGenerators().

Zero runtime dependencies

Only web-standard APIs (btoa, Math, Date) — nothing to audit, nothing to break.

Tree-shakable

Import only the modules and helpers you use. ESM + CommonJS, one package.

Runs everywhere

Node.js 18+, Bun, Deno, and every modern browser — no runtime-specific APIs.

Deterministic seeding

new ForgeData({ seed: 42 }) — identical output every run, for stable tests and snapshots.

9 built-in locales

en, bn, hi, ar, ja, fr, de, es, zh — plus a custom locale API for anything else.

Zod schema generation

fromZodSchema(forge, schema) at the /zod subpath — fake data that respects your schema's types, formats, and constraints automatically.

React integration

ForgeDataProvider, useForgeData(), useGenerator() at the /react subpath. React stays an optional peer dependency.

Built-in CLI

forgedata generate person.fullName --seed 42 — generate fake data without writing a script.

100% test coverage

Statements, branches, functions, and lines — enforced in CI, not just claimed.

16 modules, one import

Every module is a small, dependency-free class instantiated once per ForgeData.

person

fullName(), jobTitle()

internet

email(), jwt()

company

name(), catchPhrase()

finance

creditCardNumber()

location

city(), airport()

commerce

productName(), isbn()

phone

number(), imei()

date

past(), birthdate()

image

avatar(), dataUri()

lorem

sentence(), markdown()

color

hex(), tailwindColor()

vehicle

manufacturer(), vin()

animal

type(), name()

science

chemicalElement()

ai

prompt(), sqlQuery()

misc

emoji(), semver()

See the full API reference →

From your terminal

The forgedata CLI walks the real module classes — never a hand-maintained, driftable list of commands.

# npx --package=@sahinur/forgedata forgedata ...
$ forgedata generate person.fullName --seed 42
Donald Martinez

$ forgedata generate internet.email --count 3
donald.martinez@gmail.com
scott.perez@protonmail.com
ashleyrodriguez@example.com

$ forgedata list --module color --json
["color.cssColorName", "color.hex", "color.hsl", ...]

From your React app

@sahinur/forgedata/react is a separate entry point — the main package never imports React.

import { ForgeDataProvider, useGenerator } from
  "@sahinur/forgedata/react";

function UserCard() {
  const user = useGenerator(
    (forge) => ({ name: forge.person.fullName() }),
    [],
  );
  return <p>{user.name}</p>;
}

How it compares

ForgeData Faker.js
Runtime dependenciesZeroZero
Built-in CLI
React hooks
Zod schema generation
Generator introspectionlistGenerators()
Enforced 100% coverage
Locale count9100+

Faker.js ships far more locales — see the migration guide for the full picture.

Ready to forge some data?