random.ts
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

random.ts

ci Version issues

Get a random for Nodejs and browser by TypeScript

Usage

// ES6
import * as Random from 'random.ts'
// Node
var Random = require('random.ts')
 
// get random number of given range
// this is equal with getNum(100, 2)
Random.number(2, 100)
 
// if param is not number type always return 0
Random.number("string", "string")
 
// if param out of safe range always return 0
Random.number(0, 2 ** 53)
 
// get random string,default length is 6
Random.string(6)
 
// get uuid string, default length is 21
Random.uuid(12)

license

MIT

Package Sidebar

Install

npm i random.ts

Weekly Downloads

18

Version

2.0.1

License

MIT

Unpacked Size

5.37 kB

Total Files

5

Last publish

Collaborators

  • islishude