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

pass-gen

v0.0.1

Published

An easy-to-use command-line password generator

Downloads

30

Readme

node-password-generator (pass-gen)

A customizable command-line/terminal password generator

It works programatically in node and in the browser too!

Generate human-readable1 passwords quickly and easily and specify what set of characters you want to generate the password from. By default it uses the full Latin-1 charset (execept for some ambiguous characters such as space and iIl etc) to maximize entropy.

It's best understood by looking at the examples.

1 Depends on how "readable" you consider AS$é§0 to be and if your font supports Latin-1 characters.

Examples

Default usage

$ passgen
cq@öÙ]ØúüÏ-7d3VÀï½:cížm-B7Å.ò

WIFI-friendly password

$ passgen -wnl 10
xy3zg6k12h

PIN code

$ passgen -nl 4
0162

Quick copy to clipboard

$ passgen | pbcopy

See the tests folder for more examples.

Installation

npm install pass-gen -g

Usage

Command-line API

$ passgen -h

  Usage: passgen [options]

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -n --numbers                 Use 0-9
    -w --ascii                   Use a-z
    -u --ASCII                   Use A-Z
    -s --special                 Use special ASCII characters such as .,_:;@...
    -W --latin                   Use Latin-1 chars such as åöäé...
    -U --Latin                   Use uppercase Latin-1 chars such as ÅÖÄÉ...
    -S --Special                 Use special Latin-1 chars such as £§±©...
    -a --ambiguous               Exclude ambiguous characters such as [space]"oO0...
    -x --extra <custom charset>  Use a custom set
    -l --length <integer>        Set number of characters, Default: 30

Node API

  • require('pass-gen')(options, [length])
    • options (Array|Object) What charsets to use
      • numbers
      • ascii
      • ASCII
      • special
      • latin
      • LATIN
      • Special
      • ambiguous
      • extra
      • length
    • length (Int) Number of characters in password

See command-line options for what these options do

Node examples

var passgen = require('pass-gen');

// Default
passgen();

// Using array
passgen(['ascii', 'ASCII'], 10);

// Using object
passgen({
  ascii: true,
  ASCII: 1,
  numbers: 'what you set here doesn\'t matter',
  extra: '@=/.', // but this does
  length: 15 // and this
});

Note that an options object must be used if you want to specify a custom charset.

Browser usage

Compile with browserify. See Node examples.

Contribution

Please create an issue if you find something broken or would like a new feature. Do so even if you want to fix it yourself, so I know. Work of and issue pull-request to the develop branch.

Tests

Run make test to run tests. Any added or changed functionality must be tested.

License

MIT