1.2.1 • Published 2 years ago
rand-id-gen v1.2.1
Installation
$ npm install rand-id-gen --save
Example
const randIdGen = require("rand-id-gen")
// random word with default 16 word length
let id = randIdGen()
// to specify your own length
let id = randIdGen({
length: 10
})
// to compare with items in array and result in unique word
let items = [...myList]
let id = randIdGen({
array: items
})
Options
You can pass options to manipulate the generation with your preference.
Option | Type | Default | Desciption |
---|---|---|---|
length | Integer | 16 | Length of the word |
array | Array\ | undefined | Set of strings for comparision |
mixNumbers | Boolean | false | Includes numbers in the word |
onlyNumbers | Boolean | false | Flag to make the generated word |
Features
* Random word (id) generation
* Comparision with set of words