like mkdir, but mkid!
$ npm i mkid
var id = mkid()
Minimun length of the generated id
Maximum length of the generated id
List of allowed characters to be in the id
An array in which the elements cannot be the id. This is useful if you have
a url in the format example.com/:id and you want to make sure the id
generated does not match any of your navigation urls. For instance,
if you do mkdir( {cannotBe: ['home', 'contact'] })
it will
guarantee that the generated id is not 'home' and not 'contact', so that
you can have example.com/contact in your navigation.
A string of characters that the first character (id.chartAt(0)) cannot be.
So if you call mkdir( {cannotStartWith: '~5t'} )
it will return
an id where the first character cannot be ~, 5, or t.
var id = mkid({
minLength: 1,
maxLength: 10,
cannotBe: ['home', 'about', 'contact'],
cannotStartWith: '~'
})
// returns an id between 1 and 10 characters long that cannot be
// 'home', 'about', or 'contact', and does not start with ~