@zcorky/random
v1.0.0
Published
random number/string/from anything
Downloads
6
Maintainers
Readme
random
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