random-birthday
v1.0.1
Published
Generate a random birthday.
Downloads
3,015
Maintainers
Readme
random-birthday
Generate a random birthday.
Install
$ npm install --save random-birthday
Usage
var randomBirthday = require('random-birthday');
// API
// - randomBirthday([options]);
// options
// - type
// - min
// - max
By default, returns an actual JavaScript Date object.
randomBirthday();
// => Wed Apr 25 1984 00:00:00 GMT+0800 (CST)
Optionally specify the type, allowed types are: child
, teen
, adult
, senior
.
randomBirthday({ type: 'child' });
// => Tue Apr 25 2000 00:00:00 GMT+0800 (CST)
Optionally specify the min
and max
for the year:
randomBirthday({ min: 1980, max: 2000 })
// => Sun Apr 25 1999 00:00:00 GMT+0800 (CST)
Related
- random-birthday - Generate a random birthday.
- random-firstName - Generate a random first name.
- random-lastName - Generate a random last name.
- random-fullName - Generate a random full name.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.