npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

memorable-password-generator

v0.0.2

Published

Generates memorable passwords with short words and numeral sequences, with a number of configurable options.

Downloads

95

Readme

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

import { createMemorablePassword } from 'memorable-password-generator'

(async () => {
  const dictionary = ['single','dimensional','array','of','strings']

  let password = createMemorablePassword(dictionary)
  console.log(password) // 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 createMemorablePassword(dictionary) // straight32SEVEN

Patterns

pw = await createMemorablePassword(dictionary, { pattern: 'wdwdw' }) // door75THE80TWO
pw = await createMemorablePassword(dictionary, { pattern: 'ddwwddww' }) //0288theFIVE3603twoTEN

Uppercase

pw = await createMemorablePassword(dictionary, { upperCase: 'alternate' }) // my82FOUR
pw = await createMemorablePassword(dictionary, { upperCase: 'random', pattern: 'wdwdw' }) // again91SHUT78THREE
pw = await createMemorablePassword(dictionary, { upperCase: 'all' }) // TEN45EIGHT
pw = await createMemorablePassword(dictionary, { upperCase: 'none' }) // three21shoe

MaxWordLength

pw = await createMemorablePassword(dictionary, { maxWordLength: 2 }) // my33UP
pw = await createMemorablePassword(dictionary, { maxWordLength: 3 }) // THE03two
pw = await createMemorablePassword(dictionary, { maxWordLength: 4 }) // FOUR94lay

MaxNumber

pw = await createMemorablePassword(dictionary, { maxNumber: 100 }) // ONE03shoe
pw = await createMemorablePassword(dictionary, { maxNumber: 1000 }) // five036DOOR
pw = await createMemorablePassword(dictionary, { maxNumber: 10000 }) // sticks0891START