1.0.0 • Published 5 years ago

@zcorky/random v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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