Package Exports
- random-natural
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (random-natural) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
random-natural
Return a natural number.
Install
$ npm install --save random-naturalUsage
For more use-cases see the tests
var randomNatural = require('random-natural');
// API
// - randomNatural([options])
// options
// - min
// - maxBy default it will return an integer between 0 and 9007199254740992:
randomNatural();
// => 9527Can optionally provide min and max:
randomNatural({ max: 5 });
// => 3
randomNatural({ min: 10, max: 100 });
// => 66Note:
These min and max are inclusive, so they are included in the range.
This means randomNatural({ min: 1, max: 3 }) would return either 1, 2, or 3.
// Specific case
1 <= random number <= 3
// General case
min <= random number <= maxRelated
- random-integral - Return a random integer.
- random-bool - Return a random boolean (true/false).
- random-char - Return a random char.
- random-index - Return a random array-like index.
- random-decimal - Return a random decimal.
- random-binary - Return a random binary number.
- random-octal - Return a random octal number.
- random-hexadecimal - Return a random hexadecimal number.
- random-unicode - Return a random unicode.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.