random-birthday

1.0.1 • Public • Published

random-birthday

Generate a random birthday.

MIT License

build:? coverage:?

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

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i random-birthday

Weekly Downloads

396

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bubkoo