Generates mock/fake data from Zod schemas using @faker-js/faker and randexp.js. Current stable version is 2.1.1, released with a moderate release cadence. Supports Zod v3, v4 (preview), and 'mini' variants. Key differentiators include support for custom Zod types via ZodTypeFaker (v3) or Fake (v4), seedable random for reproducible tests, and a built-in randexp utility for regex-based strings. It requires Node.js >=20 and peer dependencies @faker-js/faker ^10.0.0, randexp ^0.5.3, and zod ^3.25.0 || ^4.0.0.
npm install zod-schema-fakerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs built-in fakers and generates a fake object from a Zod schema using install() and fake().
Upgrade zod to ^3.25.0 || ^4.0.0, @faker-js/faker to ^10.0.0, and ensure Node >=20.
Change import to 'zod-schema-faker' or 'zod-schema-faker/v3'.
Call install() at the top of your file or during module initialization.
For v4: import { setFaker } from 'zod-schema-faker/v4' and call setFaker(fakerInstance).Run 'npm install --save-dev zod-schema-faker @faker-js/faker randexp'.
Use named import: import { fake } from 'zod-schema-faker'.Add 'install()' before first use of fake().