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

lockly

v0.2.0

Published

Cryptographically secure random password generator CLI

Readme

lockly

Cryptographically secure password generator CLI.

Generates unpredictable random passwords instantly using the Web Crypto API (crypto.getRandomValues()).

Features

  • Cryptographically secure — CSPRNG via Web Crypto API
  • Browser compatible — works in Node.js and browsers
  • Fast — under 50ms response time
  • Customizable — length, character sets, count, charset inclusion guarantee (--ensure)
  • Pipe-friendly — clean stdout output, no ANSI colors
  • Zero install — run instantly with npx

Install

# Run instantly with npx (recommended)
npx lockly

# Or install globally
npm install -g lockly

Usage

Basic

# Default: generate a 16-character password
lockly

# Set length (32 characters)
lockly -l 32
lockly --length 32

# Generate multiple passwords (5)
lockly -c 5
lockly --count 5

Character set filtering

# Exclude symbols
lockly --no-symbols

# Digits only (PIN)
lockly --no-uppercase --no-lowercase --no-symbols -l 6

# Uppercase and digits only
lockly --no-lowercase --no-symbols

Ensure charset inclusion

# Guarantee at least one character from each active charset
lockly --ensure

# Short password with guaranteed diversity
lockly --ensure -l 4

Piping

# Copy to clipboard (macOS)
lockly | pbcopy

# Copy to clipboard (Linux)
lockly | xclip -selection clipboard

# Copy to clipboard (Windows PowerShell)
lockly | Set-Clipboard

# Save to file
lockly -c 10 -l 32 > passwords.txt

# Set as environment variable
export DB_PASSWORD=$(lockly -l 24 --no-symbols)

Options

| Option | Description | Default | Range | |--------|-------------|---------|-------| | -l, --length <number> | Password length | 16 | 1–1024 | | -c, --count <number> | Number of passwords | 1 | 1+ | | --no-uppercase | Exclude uppercase (A-Z) | included | - | | --no-lowercase | Exclude lowercase (a-z) | included | - | | --no-numbers | Exclude digits (0-9) | included | - | | --no-symbols | Exclude symbols | included | - | | --ensure | Guarantee at least one char from each active charset | off | - | | -V, --version | Show version | - | - | | -h, --help | Show help | - | - |

Security

  • CSPRNG: Uses crypto.getRandomValues() (Web Crypto API) instead of Math.random()
  • Local execution: No network requests — passwords are generated locally
  • Stateless: Generated passwords are never stored
  • No modulo bias: Rejection sampling ensures uniform distribution

Security tips

  • Store generated passwords immediately in a secure location (e.g. password manager)
  • Use piping to avoid passwords appearing in terminal history
  • Use -l 32 or longer for high-security purposes (root accounts, financial services, etc.)

Programmatic API

Use lockly as a library in your TypeScript/JavaScript project.

import { generatePassword } from 'lockly';

// Default usage
const passwords = generatePassword();
console.log(passwords[0]); // 16-character password

// With options
const customPasswords = generatePassword({
  length: 32,
  count: 5,
  uppercase: true,
  lowercase: true,
  numbers: true,
  symbols: false
});

// Ensure at least one character from each active charset
const ensured = generatePassword({
  length: 16,
  ensure: true
});

Requirements

  • Node.js 20+ or any modern browser with Web Crypto API support

License

MIT