Generate valid JSON mock data from JSON Schema definitions. v0.6.2 supports JSON Schema 2019-09 and 2020-12 with deterministic output via seeded PRNG (Mulberry32). Zero production dependencies. Key differentiators: built-in format generators (email, uuid, etc.), extension support for faker/chance, custom keywords via define(), and sequential auto-incrementing seeds via createGenerator().
npm install json-schema-fakerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generate a mock object with string, integer, email, and array properties from a JSON Schema.
Use import syntax instead of require(). If using CommonJS, use dynamic import: const { generate } = await import('json-schema-faker');Always await: const data = await generate(schema);
Pin exact version and regenerate snapshots on upgrades.
Use built-in formats directly; registerFormat is only needed for custom formats not in the standard list.
If you need the same output repeatedly, create a new generator with the same seed each time.
Use import { generate } from 'json-schema-faker'Add await: const data = await generate(schema);
Add type:module to package.json or use dynamic import: const { generate } = await import('json-schema-faker');Run npm install json-schema-faker
No dependency data recorded yet.