memorable-password-generator
Generates memorable passwords with short words and numeral sequences, with a number of configurable options.
Install
npm install --save memorable-password-generator
Usage
async { const dictionary = 'single''dimensional''array''of''strings' let password = console // single87STRINGS }
Dictionary
createMemorablePassword
expects a single-dimensional array of strings as a dictionary, which allows you to compose that argument from any function, method, or API call that returns exactly that. Or, you can hard-code it—you do you.
Options
const options = upperCase: 'alternate' // alternate (default), none, all, alternate, random pattern: 'wdw' // any combination of 'w' and 'd', representing words and digits, respectively maxWordLength: null // Specifying an integer will filter the dictionary down to words whose length does not exceed this value maxNumber: 100 // This value is an upper bound on the numerals generated by 'd' pattern segments, and will indicate how many zeroes to left-pad on those numerals
Examples
Each example assumes the following dictionary:
const dictionary = 'one''two''buckle''my''shoe''three''four''shut''the''door''five''six''pick''up''sticks''seven''eight''lay''them''straight''nine''ten''start''again'
Default options
pw = await // straight32SEVEN
Patterns
pw = await // door75THE80TWOpw = await //0288theFIVE3603twoTEN
Uppercase
pw = await // my82FOURpw = await // again91SHUT78THREEpw = await // TEN45EIGHTpw = await // three21shoe
MaxWordLength
pw = await // my33UPpw = await // THE03twopw = await // FOUR94lay
MaxNumber
pw = await // ONE03shoepw = await // five036DOORpw = await // sticks0891START