npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

random-range

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:1
$ npm install random-range
DailyWeeklyMonthlyYearly

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

  • github/jonschlinkert
  • twitter/jonschlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on October 02, 2014.