Skip to content
Logo
fabricator

fabricator

Fabricate typed data from composable schemas.

Define a shape once, get fully typed, randomized, probabilistic test data, perfectly reproducible from seed parameters.

npm install @ghostry/fabricator
import {  } from "@ghostry/fabricator";
 
const { ,  } = ({
  : new (), // default source of entropy
  : "1234", // optional additional entropy
});
 
const  = .({
  : ..({ : { : 1, : 25 } }),
  : ..({ : 1, : 500 }),
  : .,
  : ..,
  : .(..({ : { : 15 } })).({
    : { : 5 },
  }),
});
 
const  = new ();
 
const  = .();
 
const createdAtArrow
= .;
// Everything random except what you pin: const = .({ : "Widget", : true });