make-random-string

1.0.5 • Public • Published

random-string

generate random string from custom charset (or the default one) and define the length of the string. Fantastic for when you need to generate a 'throw-away' id

Usage

var randomString = require('make-random-string')


// will output an alphanumeric string of with a length of 4, case-mixed
var x = randomString(4)

//will use custom charset - the string will only be made out of the passed arg

var x = randomString(4,'abcd1234')

========================

for you sexy coffeeScript folks:

randomString = require 'make-random-string'


###will output an alphanumeric string of with a length of 4, case-mixed###
x = randomString 4

#$ xJe3

###will use custom charset - the string will only be made out of the passed arg###

x = randomString 4,'abcd1234'

#$ ad2d

Package Sidebar

Install

npm i make-random-string

Weekly Downloads

41

Version

1.0.5

License

MIT

Last publish

Collaborators

  • bags3071