quicktools
v1.0.9
Published
A pack of small utility for your day to day development.
Downloads
2
Readme
Quicktools!
A utility library providing you with a set of handy tools you always find indispensable in your development.
Installation
To install
npm install quicktools
Usage
For detailed explanation on length and character formatting, see randomstring npm module. Functions include
generateID
Used to generate a randomized string of given length and character composition, ideal for id purposes. Built on the randomstring npm module, and uses a fully compatible argument with the addition of a "notFoundIn" object for random string uniqueness. The default length of string is 5, and charset is numeric. For any given length in use (default or set) this method will return a string with length+1 characters if the total number of properties or entries in notFoundIn object exceeds the total number of strings of the length.
var { generateID } = require("quicktools");
var notFoundIn = {
id1: { ... },
id2: { ... },
...
}
var id = generateID({ notFoundIn });
// id will not be equal to 'id1' or 'id2'
notFound in object can also be an array of strings.
var notFoundIn = ["id1", "id2", ...];