@schmock/faker
v2.4.0
Published
Faker-powered automatic data generation for Schmock
Downloads
622
Readme
@schmock/faker
Faker-powered automatic data generation for Schmock. Turns JSON Schema into realistic, field-name-aware mock data.
Part of Schmock — mock APIs from OpenAPI specs or hand-crafted routes.
Install
bun add -d @schmock/fakerUsage
import { schmock } from "@schmock/core";
import { fakerPlugin } from "@schmock/faker";
const mock = schmock();
// Plugins are instance-wide: this fills any route that produced no response.
mock.pipe(
fakerPlugin({
seed: 42,
count: 3,
schema: {
type: "array",
items: {
type: "object",
properties: { id: { type: "integer" }, email: { type: "string" } },
},
},
}),
);
mock("GET /users", undefined);Documentation
License
MIT © Khalic Lab
