lacspace-fake

Deterministic fake data → JSON/CSV/SQL, now relational.

terminal
npx lacspace-fake
What it does

Everything, in one command

lacspace-fake turns a tiny schema into realistic test data — names, emails, phones, addresses, prices, timestamps, UUIDs and 60+ more generators — and prints it in whatever shape your workflow needs, including escaped SQL inserts that seed a database in one command. Every value is drawn from a seeded mulberry32 PRNG, so a fixed seed produces byte-identical output on every machine, ideal for reproducible fixtures and CI. It runs fully offline with no API key, no account and no telemetry, and it speaks a Nepal locale out of the box.

Features

What's inside

Schema-driven rows

Inline --fields string or a JSON schema file with nested objects and arrays.

Deterministic --seed

Same seed, byte-identical output, forever.

Four outputs

JSON, NDJSON, CSV (header row) and safe SQL INSERTs.

Injection-safe SQL

String values are quote-escaped and identifiers quoted.

60+ generators

person, internet, address, company, commerce, text, datetime, ids.

Nepal locale

Nepali names, districts/provinces, NPR, +977 phones, PAN/VAT.

Zero-dep & offline

Nothing to audit, nothing phones home, no key.

Linked tables with FKs

Generate users then orders where userId: ref(users.id) — every foreign key is guaranteed to exist.

Template fields

Compose values like full:template({{firstName}} {{lastName}}) from earlier fields or generators.

Unique constraints

unique(uuid) guarantees no duplicate values across rows.

CREATE TABLE DDL

--ddl emits schema with column types inferred from the data.

Spanish & French locales

Realistic names, addresses and phones in es/fr (plus en/ne).

15+ new generators

ULID, hex/rgb/hsl colour, semver, MIME type, file paths, timezone, IBAN/BIC, masked credit card.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

Five users as JSON
terminal
npx lacspace-fake --fields "id:autoincrement,name:fullName,email:email,age:int(18..65)" -n 5

Fields evaluate in order; email derives from the name.

Seed a table with SQL
terminal
npx lacspace-fake --fields "id:autoincrement,name:fullName,role:oneOf(admin|user)" -n 100 -f sql --table users

Escaped INSERT INTO … VALUES ready to pipe into a DB.

JSON schema → CSV file
terminal
npx lacspace-fake --schema users.json -n 50 -f csv -o users.csv

Nested objects/arrays supported.

Nepal locale
terminal
npx lacspace-fake --fields "name:fullName,phone:phone,district:city" --locale ne -n 10

Romanized Nepali names + +977 mobiles.

Reproducible fixture
terminal
npx lacspace-fake email -n 5 --seed 42

Same seed always yields the same five emails.

Discover generators
terminal
npx lacspace-fake list

Every generator with a sample value.

Linked tables → SQL with DDL
terminal
npx lacspace-fake --relations shop.json -f sql --ddl

Foreign keys resolve to real parent ids; CREATE TABLE types inferred.

Template + unique fields
terminal
npx lacspace-fake --fields "id:unique(uuid),first:firstName,handle:template({{first}}-{{int(1..99)}})" -n 5

No duplicate ids; handle interpolates the row's own fields.

French locale
terminal
npx lacspace-fake --fields "name:fullName,phone:phone" --locale fr -n 5

French names and +33 mobiles, deterministic under --seed.

New generators
terminal
npx lacspace-fake ulid -n 5 --seed 42

Also iban, semver, hexColor, mimeType, filePath, timezone.

Good for

What people build with it

✓ Seed dev/test databases in one command

✓ Reproducible unit/integration test fixtures

✓ Demo and staging data

✓ Prototype a UI before a real backend exists

Start now

Run lacspace-fake today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-fake