random-octal

1.0.2 • Public • Published

random-octal

Return a random octal number.

MIT License

build:? coverage:?

Install

$ npm install --save random-octal

Usage

For more use-cases see the tests

var randomOctal = require('random-octal');
 
// API
// - randomOctal([options]);
 
// options
// - min
// - max

By default it will return an octal number between 0 and 9007199254740992:

randomOctal();
// => '0o147'

Can optionally provide min and max:

randomOctal({ max: 7 });
// => '0o4'
 
randomOctal({ min: 4, max: 7 });
// => '0o6'

Note: these min and max are inclusive, so they are included in the range.

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i random-octal

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • bubkoo