Generates an array of user profile objects based on the specified ethnicity and age range.
genRandomProfiles module creates mock user data for testing or development purposes. Each profile includes a unique login ID, full name, email address, and date of birth (DOB) derived from the age and ethnicity constraints.
| Name | Type | Description |
|---|---|---|
ethnicities |
string[] |
Array of ethnicities to generate profiles from. Supported: "american", "russian", "chinese", "indian" |
ageRange |
number[] |
Maximum age (inclusive). Profiles will be aged between ageRange[0] and ageRange[1]. |
count |
number |
Number of profiles to generate. |
Object[] - An array of profile objects, each containing the following keys:
loginId(string): Unique identifierfullName(string): Generated full name based on ethnicityemail(string): Email addressdob(ISODate): Date of birth
const genRandomProfiles = require('genrandomprofiles');
const profiles = genRandomProfiles(["russian", "indian"], [18, 40], 10);
console.log(profiles[0]);
// {
// loginId: "user1987",
// fullName: "Vladimir Ivanov",
// email: "vladimirivanov@gmail.com",
// dob: "1987-11-05"
// }