Skip to main content
Interface Forge Logo

Interface Forge

A TypeScript library for creating strongly typed mock data factories using Faker.js for test data generation

🔒

Type-Safe Mock Generation

Generate mock data that perfectly matches your TypeScript interfaces. Get full IntelliSense support and compile-time type checking for all your factories.

🎭

Powered by Faker.js

Built on top of the popular Faker.js library, giving you access to realistic fake data for names, addresses, dates, and more out of the box.

âš¡

Schema Integration

Optional Zod schema integration allows you to generate mock data directly from your runtime validation schemas with zero additional configuration.

See It In Action

import { Factory } from 'interface-forge';

interface User {
id: string;
name: string;
email: string;
age: number;
}

const userFactory = new Factory<User>((factory) => ({
id: factory.string.uuid(),
name: factory.person.fullName(),
email: factory.internet.email(),
age: factory.number.int({ min: 18, max: 65 }),
}));

// Generate a single user
const user = userFactory.build();

// Generate multiple users
const users = userFactory.batch(10);