v0.2.0 · 111+ generators · 100% test coverage
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
Modules
Locales
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..."
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…
Built from scratch as a clean-architecture alternative to Faker.js — not a fork.
16 modules — person, internet, finance, location, commerce, date, lorem, color,
vehicle, ai, and more. Discoverable at runtime via forge.listGenerators().
Only web-standard APIs (btoa, Math, Date) — nothing to audit, nothing to break.
Import only the modules and helpers you use. ESM + CommonJS, one package.
Node.js 18+, Bun, Deno, and every modern browser — no runtime-specific APIs.
new ForgeData({ seed: 42 }) — identical output every run, for stable tests and snapshots.
en, bn, hi, ar, ja, fr, de, es, zh — plus a custom locale API for anything else.
fromZodSchema(forge, schema) at the /zod subpath — fake data that respects your schema's types, formats, and constraints automatically.
ForgeDataProvider, useForgeData(), useGenerator() at the /react subpath. React stays an optional peer dependency.
forgedata generate person.fullName --seed 42 — generate fake data without writing a script.
Statements, branches, functions, and lines — enforced in CI, not just claimed.
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()
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", ...]
@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>; }
| ForgeData | Faker.js | |
|---|---|---|
| Runtime dependencies | Zero | Zero |
| Built-in CLI | ✅ | ❌ |
| React hooks | ✅ | ❌ |
| Zod schema generation | ✅ | ❌ |
| Generator introspection | listGenerators() | — |
| Enforced 100% coverage | ✅ | — |
| Locale count | 9 | 100+ |
Faker.js ships far more locales — see the migration guide for the full picture.