Socket
Book a DemoInstallSign in
Socket

random-range

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-range

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

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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.

Keywords

algorithm

FAQs

Package last updated on 02 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts