random-age
Version:
Generate a random age.
60 lines (35 loc) • 1.47 kB
Markdown
# random-age
> Generate a random age.
[](https://github.com/mock-end/random-age/blob/master/LICENSE)
[](https://travis-ci.org/mock-end/random-age)
[](https://coveralls.io/github/mock-end/random-age)
## Install
```
$ npm install --save random-age
```
## Usage
```js
var randomAge = require('random-age');
// API
// - randomAge();
// - randomAge([options]);
```
Default range is between `1` and `120`:
```js
randomAge();
// => 45
```
Optionally specify one of a handful of enumerated age types:
```js
randomAge({ type: 'child' });
// => 9
```
Allowed types are: `child`, `teen`, `adult`, `senior`.
## Related
- [random-birthday](https://github.com/mock-end/random-birthday) - Generate a random birthday.
- [random-firstName](https://github.com/mock-end/random-firstName) - Generate a random first name.
- [random-lastName](https://github.com/mock-end/random-lastName) - Generate a random last name.
- [random-fullName](https://github.com/mock-end/random-fullName) - Generate a random full name.
## Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please [create an issue](https://github.com/mock-end/random-age/issues/new).