Net Possibility Multiplier

npm

Need private packages and team management tools?Check out npm Orgs. »

random-unified

4.0.0-canary.0 • Public • Published

random-unified Build Status

Generate/Get something random. Unified version of sindresorhus's random packages.

fork of

  • sindresorhus/random-int
  • sindresorhus/random-float
  • sindresorhus/random-item
  • sindresorhus/random-obj-key
  • sindresorhus/random-obj-prop
  • sindresorhus/unique-random
  • sindresorhus/unique-random-array
  • sindresorhus/crypto-random-string

Install

$ npm install --save random-int

Usage

var random = require('random-unified');
 
random.int(5);
//=> 3
 
random.int(10, 100);
//=> 54
 
random.float(5);
//=> 4.401887938147411
 
random.float(10, 100);
//=> 72.34217455144972
 
random.item(['pony', 'unicorn', 'rainbow']);
//=> 'unicorn'
 
random.boolean();
//=> true
 
random.boolean();
//=> false
 
random.obj_key({foo: true, bar: true});
//=> 'bar'
 
random.obj_prop({foo: 'pony', bar: 'unicorn'});
//=> 'unicorn'
 
const rand = random.unique(1, 10);
 
console.log(rand(), rand(), rand());
//=> 5 2 6
 
const random = random.unique_array([1, 2, 3, 4]);
 
console.log(random(), random(), random(), random());
//=> 4 2 1 4
 
random.crypto(10);
//=> '2cf05d94db'

Original Repository

License

MIT © Sindre Sorhus Modified by startergate

install

npm i random-unified

Downloadsweekly downloads

1

version

4.0.0-canary.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability