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

ts-pwgen

v1.2.2

Published

A command line password generator in TypeScript

Downloads

42

Readme

ts-pwgen

Command-Line Password Generator in TypeScript

npm npm

Installation

npm install -g ts-pwgen

Good to know

  • It has a default password length of 30 characters
  • It uses lowercase/uppercase letters, numbers and special characters when you don't pass any arguments saying otherwise
  • It uses crypto.randomBytes() instead of Math.random().
  • You should try the --verbose flag to see how long it would take a supercomputer (10^12 pw/sec) to crack your generated password
  • Use -k if you don't like the copy-to-clipboard feature

Demo

demo video

Usage

pwgen --help
Usage: pwgen [--length 10] [--parts 3] [--delimiter "-"] [--count 3] [-aAns]

Options:
  -p, --parts      Define how many parts there should be
  -l, --length     Define the length of a part
  -d, --delimiter  Define the delimiter to use if there are multiple parts
  -c, --count      Define how many passwords to generate           [Standard: 1]
  -a, --ascii      Use lowercase letters                               [boolean]
  -A, --ASCII      Use uppercase letters                               [boolean]
  -n, --numbers    Use numbers                                         [boolean]
  -s, --special    Use special characters                              [boolean]
  -x, --latin1     Use latin1 characters                               [boolean]
  -v, --verbose    Verbose output, see how long it would take a supercomputer to
                   crack your generated password(s)  [boolean] [Standard: false]
  -k               Do not copy the password to the clipboard
                                                     [boolean] [Standard: false]
  --version        Display current version                             [boolean]
  -h, --help       Show help                                           [boolean]

Examples

Custom length

pwgen -l 16 or pwgen --length 16 or pwgen --length=16

-TI)!9~GmQm~a=jj

Parts with delimiter

pwgen --parts=3 --length=5 --delimiter="-"

1TX)C-rivp<-MWvZ5

ProTip: Use parts for WiFi-friendly passwords

pwgen -p 4 -l 5 -an

jhnxp-geehp-rtz2n-3m4vt

The delimiter defaults to -.

See how long it would take a supercomputer to crack your password

pwgen -l 16 -v

Password length:       16
Different characters:  91
Possible combinations: 2.211374397284394e+31

Required time to crack (10^12 passwords/s)
              Seconds: 11056871986421970000
                Years: 350566645098.98
  Age of the universe: 25.71

a*aO)~}xv|4s+Z4*

Password successfully copied to clipboard!

Create multiple passwords

pwgen -c 5

@T:6Z8}5G"dIENbab^qvh;^}##LY{F
3Qy7@`&Ujh;aQL0dMz%@M(IfswdLfa
Sg5O+@L<:Ni1E>k<F>{,XvS|{Y|^W|
ZKf/]e-unOP8YWPv4W@eYe*yL6{lk}
N^)@rFD+1F-G!v%UZcxeV)FzIMfn]]

Use lowercase letters only

pwgen -a

jpgthoyjmwumnoiroqynbhywoxhjnb

Use uppercase letters only

pwgen -A

AUAYYZJXWMIKMPJGHVQSPKUGPUFTCU

Use numbers only

pwgen -n

647681199479680747570268980919

Use special characters only

pwgen -s

=<}(<>}/,_.*@:|<*++"=)^;^:|)_+

Use latin1 characters only

pwgen -x

»°ÃÑîÍí¢ÆñÓò¾ÅÚïñ°ÕÔÏúñ¼Ï´¦îÓê

Use letters and numbers (combine charsets)

pwgen -aAn

APlngye5IiXTu0z7NETffgS67bOX48

Development

Unit tests

npm test

Build from TypeScript source

npm run build