Random number, random string, random from anything>
$ npm install @zcorky/random
// 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']
MIT © Moeover