Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

random-age

mock-end935MIT1.0.2

Generate a random age.

age, child, teen, adult, senior, person, random, randomly, randomize, chance, test, dice, mock

readme

random-age

Generate a random age.

MIT License

build:? coverage:?

Install

$ npm install --save random-age 

Usage

var randomAge = require('random-age');

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

Default range is between 1 and 120:

randomAge();
// => 45

Optionally specify one of a handful of enumerated age types:

randomAge({ type: 'child' });
// => 9

Allowed types are: child, teen, adult, senior.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.