npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

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.

install

npm i random-birthday

Downloadsweekly downloads

5

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability