alepha@docs:~/docs/packages/alepha$
cat fake.md
1 min read
Last commit:

#Alepha - Fake

#Installation

Part of the alepha package. Import from alepha/fake.

npm install alepha

#Overview

Provides fake data generation capabilities for Alepha applications using faker.js and TypeBox schemas.

The fake module enables declarative fake data generation from TypeBox schemas, making it easy to create realistic test data, seed databases, or generate mock responses. It intelligently uses property key names to generate contextually appropriate data (e.g., "email" generates an email address, "firstName" generates a first name).

#API Reference

#Providers

Providers are classes that encapsulate specific functionality and can be injected into your application. They handle initialization, configuration, and lifecycle management.

For more details, see the Providers documentation.

#FakeProvider

Faker locale to use for generating fake data. @default "en" / locale?: string;

/** Seed for deterministic fake data generation. / seed?: number; }

/** Generate fake data from TypeBox schemas using faker.js.

ts
1const fake = new FakeProvider();2const userSchema = t.object({3  id: t.uuid(),4  name: t.text(),5  email: t.email(),6});7const fakeUser = fake.generate(userSchema);
On This Page
No headings found...
ready
mainTypeScript
UTF-8packages_alepha_fake.md