Skip to content

mock-end/random-year

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

random-year

Generate a random year.

MIT License

build:? coverage:?

Install

$ npm install --save random-year 

Usage

var randomYear = require('random-year');

// API
// - randomYear([options]);

// options
// - min
// - max

By default, max is the current year and min is 100 years smaller than max.

randomYear();
// => 1998

Optionally specify min, max, or both to limit the range.

randomYear({ max: 2000 }); // min will be 1900
// => 1967

randomYear({ min: 1900 }); // max will be 2000
// => 1989

randomYear({ min: 1900, max: 2100 });
// => 2003

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

About

Generate a random year.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published