Giter Club home page Giter Club logo

node-password-generator's Introduction

node-password-generator (pass-gen)

A customizable command-line/terminal password generator

It works programmatically 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
    -i --interactive             Interactive mode

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

node-password-generator's People

Watchers

Jukka Paulin avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.