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

xkpasswd

v1.0.5

Published

Memorable password generator

Downloads

897

Readme

xkpasswd

NPM Version NPM Downloads Build status Coveralls coverage

Memorable password generator, inspired by a PERL module powering xkpasswd.net/s/

Also available in Go: xkpasswd-go

Using as a node module

You can use xkpasswd as a module in your application.

EXAMPLE

var xkpasswd = require('xkpasswd');

console.log(xkpasswd());
valuable=bear=difference=53

console.log(xkpasswd({complexity: 5, separators: '#+-'}));
addition#wheat#congress#manner#lonely#20

console.log(xkpasswd({wordList: __dirname + '/myWordList.json'}));
apple#grape#banana

Using as a command in terminal

You can also use xkpasswd command in your terminal if you install the package globally (npm install xkpasswd -g).

CLI OPTIONS

xkpasswd --complexity <number> --separators <string> --pattern <string> --transform <string> --number <number> --wordList <string>

xkp alias for is also provided for convenience. You can use it interchangeably with xkpasswd command.

You can specify complexity argument in accordance with complexity levels table. Defaults to 2.

If specified pattern argument overrides the pattern derived from complexity level.

If separators are provided they are used instead of the standard set (see complexity levels). One separator is used per password, picked randomly from the provided set.

You can set transform option to alternate or uppercase to trigger case transformation.

To generate multiple passwords at once you can specify the desired amount with the number argument. Defaults to 1.

Finally if you'd like to use a custom list of words you can provide it as a JSON file, text file or an array via wordList function.

Using hyphen (-) as a separator

Due to the way the arguments are parsed make sure to use equals sign instead of space if you'd like to use a hyphen (-) as your separator: xkpasswd -s=-.

EXAMPLE Default behaviour

$ xkpasswd
hide+threw+money+61

EXAMPLE Specify complexity

$ xkpasswd -c 5
join=industrial=wide=direction=lungs=16

$ xkpasswd -c 6
57!FIFTHLY!astronauts!AFFECTEDLY!nymphs!TRUSTLESSNESSES!06

EXAMPLE Specify custom pattern

$ xkpasswd -p wdwd

adjective3solar6

EXAMPLE Specify custom word list / dictionary

$ xkpasswd -wordList myWordList.json

orange.apple.banana
$ xkpasswd -dict myWordList.txt

kiwi-strawberry-grape

EXAMPLE Specify complexity, custom separators and number of passwords

$ xkpasswd -c 3 -s '#!+' -n 5

dog!friend!successful!47
other#sell#close#01
hyperspatial+polyvalences+inquirendo+03
war#reassemble#inventress#93
gainsays+illumes+discontiguity+86

Patterns

Patterns can consist of any combination of words, digits and separators. The first letters (w, d and s respectively) are used in pattern string provided to the password generation function.

For example:

  • w will return a single word (i.e. demographics). Use w for lowercase and W for uppercase.
  • wsd will return a word and a digit, separated by one of the permitted separators (i.e. storm#7)
  • wswsdd will return two words followed by a two digit number, all with separators between (i.e. delates+dissembled+16)

Complexity levels

There are 6 complexity levels specified which can be used to provide default patterns as well as trigger additional features, such as alternate casing between words and expanded sets of separators.

| Complexity | Pattern | Separators | |------------|-----------------|------------------| | 1 | wsw | #.-=+_ | | 2 | wswsw | #.-=+_ | | 3 | wswswsdd | #.-=+_ | | 4 | wswswswsdd | #.-=+_ | | 5 | wswswswswsd | #.-=+!$*:~? | | 6 | ddswswswswswsdd | #.-=+!$*:~?%^&; |

In addition level 6 alternates upper and lower case between words.

Release notes

v1.0.5

  • Added support for custom word lists
  • Improved linting profile

v1.0.4

  • Added Coveralls integration and badge

v1.0.3

  • Added tests and linting (thanks @yogendra)

v1.0.2

  • Added transform option (thanks @yogendra)

v1.0.1

  • Using a cleaned up list of words

v1.0.0

  • updated complexity levels
  • fixed uppercase/lowercase transformation
  • cleaned up code and documentation