schema-pop is a JavaScript library for populating data structures based on a schema definition. Current stable version is 0.1.42, with active development and frequent minor releases. It differentiates from similar tools by focusing on schema-driven data generation for testing and prototyping, offering a simple API and support for nested objects and arrays. This library is lightweight, has no external runtime dependencies, and is published as both ESM and CommonJS modules, with TypeScript type definitions included.
npm install schema-popNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of populate() with a schema including strings, numbers, nested objects, and arrays. Overrides specific fields with provided values.
If you need stable order, sort the array after population or upgrade to version 0.2.0+
Define a type for your schema and cast the result: const data = populate<MyType>(schema);
Replace `generate(schema)` with `populate(schema)`.
Seed the random number generator if supported, or use your own deterministic generation.
Use named import: import { populate } from 'schema-pop'Install package: npm install schema-pop
Ensure schema is a plain object or array describing types
No dependency data recorded yet.