random-range
v0.1.0
Published
Generate an array of random number ranges. Useful for creating test fixtures or benchmarking samples.
Downloads
19
Readme
random-range
Generate an array of random number ranges. Useful for creating test fixtures or benchmarking samples.
Install
Install with npm:
npm i random-range --save-dev
Run tests
npm test
Usage
var randomRange = require('random-range');
randomRange(25);
//=> [19, 24]
randomRange(25);
//=> [0, 11]
randomRange(25);
//=> [10, 14]
If a number is passed as a second argument, an array of ranges will be returned:
randomRange(25, 5);
//=> [ [ 7, 23 ], [ 25, 26 ], [ 7, 18 ], [ 4, 26 ], [ 10, 12 ] ]
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on October 02, 2014.