Skip to content
/ random Public

Random number, random string, random from anything

License

Notifications You must be signed in to change notification settings

zcorky/random

Repository files navigation

random

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

Random number, random string, random from anything>

Install

$ npm install @zcorky/random

Usage

// typescript, see more in test
import random, { string, from as randomFrom } from '@zcorky/random';

random(0, 10); // random one integer value
// => 8

string(8); // random string, length is 8
// => cdef19ED

randomFrom([ // random one from array of string
  'http://example11.com',
  'http://example12.com',
  'http://example13.com',
]);

randomFrom([ // random 2 from array of string
  'http://example11.com',
  'http://example12.com',
  'http://example13.com',
], 2);
// => ['http://example11.com', 'http://example13.com']

License

MIT © Moeover

About

Random number, random string, random from anything

Resources

License

Stars

Watchers

Forks

Packages

No packages published