API Reference
createMimic(locale?: string): Mimic
Creates a new Mimic instance for the given locale. Defaults to 'en_US'.
const mimic = createMimic('en_US');
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
locale | string | 'en_US' | Locale code (e.g., id_ID, ja_JP, de_DE) |
Returns
A Mimic instance with the following modules:
| Module | Description |
|---|---|
identity | Name, gender, age, date of birth generators |
location | Street, city, state, zip code, address generators |
physical | Height, weight generators (locale-aware units) |
work | Job title, department generators |
contact | Email, phone, website generators |
company | Company name, industry, catchphrase generators |
Mimic.setLocale(locale: string): void
Switches the instance's locale at runtime. Clears all cached generators.
Mimic.generateMockEntities(count: number, options?): object[]
Generates an array of combined mock entities (person + address + physical + work + contact + company).
Options
| Option | Type | Description |
|---|---|---|
gender | 'male' | 'female' | Filter by gender |
ageRange | { min: number, max: number } | Age range filter |
Mimic.generateUniqueMockEntities(count: number, options?): object[]
Same as generateMockEntities, but deduplicates by full name.
Random.seed(value: number): void
Seeds the global PRNG with a specific value for deterministic output.
Random.unseed(): void
Reverts the PRNG to use Math.random().