Fabricate typed data from composable schemas.
Full type inference, seeded reproducibility, and fixtures that don't churn when the schema changes.
This is the monorepo for fabricator and its companion packages.
| Package | Version | Description |
|---|---|---|
@ghostry/fabricator |
The core library. | |
@ghostry/fabricator-adapter-typebox-v0 |
Converts any Fabricator Schema to a TypeBox v0 schema. | |
@ghostry/fabricator-extension-faker-v10 |
Faker v10 generators, seeded through the fabricator instance that calls them. |
npm install @ghostry/fabricatorimport { initialize } from "@ghostry/fabricator";
const { T, Fabricator } = initialize();
const ProductSchema = T.object({
name: T.string.whereby({ length: { min: 1, max: 25 } }),
price: T.number.whereby({ min: 1, max: 500 }),
inStock: T.boolean,
});
const Product = new Fabricator(ProductSchema);
const item = Product.fabricate();
// { name: "...", price: ..., inStock: ... }See the docs site for the full guide.
MIT © Patrick Rebsch