1.0.2 • Published 8 years ago

random-octal v1.0.2

Weekly downloads
28
License
MIT
Repository
github
Last release
8 years ago

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.