StandardID
Generate IDs using the same format
This can be useful if you have user facing IDs that you want to be consitently formatted
Install
$ npm install standardid
Usage
const standardID = // Require the module // Create a new generator// This will generator an ID of 3 uppercase alphabets followed by 3 digitslet generator = "AAA000"; // Generate a new IDlet newID = generator; // Set blueprint after generator is createdgeneratorblueprint = "aaaa";newID = generator; // Placeing a ! will now select from the given stringgeneratorspecifiers"!" = ".!><?";generatorblueprint = "!!!";newID = generator;
By default the specifiers are:
"A":"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "a":"abcdefghijklmnopqrstuvwxyz" "0":"0123456789"