npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

random-id

1.0.3 • Public • Published

random-id

random id generator

Installation

npm install --save random-id

or with yarn

yarn add random-id

Usage

npm

var randomId = require('random-id');
 
// length of the id (default is 30)
var len = 30;
 
// pattern to determin how the id will be generated
// default is aA0 it has a chance for lowercased capitals and numbers
var pattern = 'aA0'
 
var id = randomId(len, pattern)

using it in a script tag it'll add randomId to the window for global use

// length of the id (default is 30)
var len = 30;
 
// pattern to determin how the id will be generated
// default is aA0 it has a chance for lowercased capitals and numbers
var pattern = 'aA0'
 
var id = randomId(len, pattern)

Keywords

none

install

npm i random-id

Downloadsweekly downloads

6,735

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability