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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nilesh-padiyar/pwgen

v1.1.0

Published

Command-line password generator: secure, flexible, copy-ready

Readme

pwgen 🔐

pwgen is a fast, secure CLI tool for generating passwords and passphrases directly from your terminal.

Built with Node.js + TypeScript, it uses cryptographically secure randomness and supports both traditional character-based passwords and modern Diceware passphrases.


✨ Features

🔐 Password Generation

  • Generate secure passwords of any length

  • Fully customizable character sets:

    • Numbers
    • Lowercase
    • Uppercase
    • Symbols

🎲 Diceware Passphrases (v1.1.0)

  • Generate human-readable, secure passphrases
  • Custom word count and separators
  • Optional capitalization

🧠 Entropy & Strength Analysis (v1.1.0)

  • Calculate password entropy (in bits)
  • Classify strength: Weak → Very Strong
  • Optional --stats flag to display analysis

📋 Clipboard Support

  • Copy generated passwords directly to clipboard

Clipboard support works reliably on Windows and macOS.

⚠️ On some Linux systems (especially Wayland), the CLI may appear to hang after copying. The password is usually copied successfully. Press Ctrl + C to exit if needed.

⚡ CLI First

  • Lightweight and fast
  • Simple, developer-friendly commands

📦 Installation

npm install -g @nilesh-padiyar/pwgen

NOTE:-

Before installing, make sure you have:

  1. Node.js (version 14 or higher recommended)
  2. npm (comes with Node.js)

Check versions in terminal:

node -v #Node.js version check
npm -v  #npm version check

🚀 Usage

🔐 Generate Passwords (Character-Based)

# Default (10 chars)
pwgen generate

# Custom length
pwgen generate -L 20

# Show entropy & strength
pwgen generate --stats

# Copy to clipboard
pwgen generate -c

# Disable specific character sets
pwgen generate -L 12 --no-u --no-s

Example Output:

FEP39S$vA*
Entropy: 63.58 bits
Strength: Medium

🎲 Generate Diceware Passphrases

# Default (5 words)
pwgen diceware

# Custom word count
pwgen diceware -w 4

# Show entropy & strength
pwgen diceware --stats

# Custom separator
pwgen diceware -w 4 -s "_"

# Capitalized words
pwgen diceware -w 5 -C

# Copy to clipboard
pwgen diceware -c

Example output:

orbit-ember-shadow-tiger-forest
Entropy: 64.62 bits
Strength: Medium

🧠 Why pwgen?

  • Uses Node.js crypto module for secure randomness

  • Designed for developers who prefer terminal workflows

  • Provides transparent security metrics (entropy + strength)

  • Supports both:

    • 🔑 Strong random passwords
    • 🧠 Memorable passphrases

⚙️ CLI Options

generate

  • -L, --length <length> → Password length (default: 10)
  • -n, --numbers → Include numbers
  • -l, --lowercase → Include lowercase
  • -u, --uppercase → Include uppercase
  • -s, --special → Include symbols
  • -c, --copy → Copy to clipboard
  • --stats → Show entropy and strength

diceware

  • -w, --words <number> → Number of words (default: 5)
  • -s, --separator <sep> → Separator (default: "-")
  • -C, --capitalize → Capitalize words
  • -c, --copy → Copy to clipboard
  • --stats → Show entropy and strength

🛠 Development

git clone https://github.com/nilesh-padiyar/pwgen.git
cd pwgen
npm install
npm run build

Run locally:

node dist/index.js

🔗 Use Locally (Optional)

npm link
pwgen generate

CLI Configuration:

Make sure your package.json includes:

"bin": {
    "pwgen": "dist/index.js"
}

And you entry file (index.js) starts with shebang:

#!/usr/bin/env node

🔄 Update

npm update -g @nilesh-padiyar/pwgen

🧱 Tech Stack

  • TypeScript
  • Node.js
  • CAC (CLI framework)
  • clipboardy
  • chalk
  • Node.js crypto module

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

MIT — free to use, modify, and distribute


👨‍💻 Author

Nilesh Padiyar