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

Package detail

random-range

Generate an array of random number ranges. Useful for creating test fixtures or benchmarking samples.

algorithm, benchmarking, combinatorics, efficient, equally, finite, fisher, fixtures, knuth, letters, permutation, random, randomly, replacement, samples, set, shuffle, shuffled, shuffling, string, terms, test, unbiased, word, words, yates

readme

random-range NPM version

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.