generate-person
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

generate-person

to install

npm install generate-person

A simple use to generate People by Nationality, age and sex.

import { Nationality, Person } from 'generate-person';
const p1 = Person();
/*  { name: 'Jérémy',
      surname: 'Julien',
      height: 195,
      nationality: 'France',
      birthday: '10/9/1994',
      sex: 'male',
      email: 'jeremy.julien@generateperson.com',
      weight: 109 }*/
const p2 = Person({nationality: Nationality.Germany, sex: 'male'});
/* { name: 'John',
      surname: 'Baumann',
      height: 185,
      nationality: 'Germany',
      birthday: '2/27/1999',
      email: 'john.baumann@generateperson.com',
      sex: 'male',
      weight: 88 } */
const p3 = Person({birthdayOptions: {
        near: '1980-MM-DD',
        variance: 5, // years
        format: 'YYYY-MM-DD' //dayjs format
    }}
/*{ name: 'Սոնա',
      surname: 'Մովսեսյան',
      height: 177,
      nationality: 'Armenia',
      birthday: '1980/10/08',
      sex: 'female',
      email: 'test.test@generateperson.com',
      weight: 67 }*/


const people = People(10, {nationality: Nationality.Germany});
/* generate people by number */

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    15
    • latest

Version History

Package Sidebar

Install

npm i generate-person

Weekly Downloads

12

Version

1.1.0

License

MIT

Unpacked Size

339 kB

Total Files

7

Last publish

Collaborators

  • carloleonardi