rand-id-gen
v1.2.1
Published
Generates random words, with default word length 16
Readme
Installation
$ npm install rand-id-gen --saveExample
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<String> | 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