0.3.0 • Published 4 years ago

xkcd-pass-gen v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

XKCD-based Password Generator - Based on XKPasswd - Bart Busschots https://xkpasswd.net

dependency status Downloads Version GitHub issues Build Status

Generates a password based on parameters.

Install

To install in your projects:

npm install --save xkcd-pass-gen

Usage

Options

NameTypeOptionalDefaultDescription
numPasswordsintTrue1Number of passwords to be generated
numWordsintTrue2Number of words in each generated password
minLengthintTrue4Minimum length of word generated
maxLengthintTrue4Maximum length of word generated
sepTypestringTrue'none'none none, specified spec(specific character specified in .sep), random character rand(random character from array of characters given in .sep)
sepstring/arrayTrue'-'Character(s) to be used as separators. Either single character or array depending on separator type
wCasestringTrue'alt'Word case. Options: Alternating alt, First Letter first, lowercase lower, uppercase upper, capitalize every letter except the first except
padDigBeintTrue0Number of digits to add at the front
padDigAfintTrue2Number of digits to add at the end
padsTypeintTrue'none'Padding to end symbol type. Options: none none, specified spec, random symbol rand
padsLocintTrue'end'Padding symbol location. Will only be used if padsType is set to something other than none. Options: beginning beg, end end, both both
padsAmountintTrue2Number of symbol characters to be added. Will only be used if padsType is set to something other than none.
padsintTrue'$'Symbol(s) to be used as padding. Either single character or array depending on separator type.

Example

const genPasswords = require('xkcd-pass-gen');
 
// Passing in nothing will print default wordWORD##
genPasswords().then((result) => {
  console.log(result);
});

// Passing in some parameters
const options = {
  numPasswords: 4,
  numWords: 3,
  minLength: 2,
  maxLength: 4,
};

genPasswords(options).then((result) => {
  console.log(result);
});

Lambda

You can create a nodejs lambda function with the lambda folder.

Questions?