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

@poorvithmp/safegen

v2.2.0

Published

Typed, zero-dependency credential generation and auditing for browsers and Node.js.

Readme

@poorvithmp/safegen

Credential generation and generation-strength estimates for browsers and Node 20+. The core has no runtime dependencies and uses Web Crypto with rejection sampling. It does not make network requests or store generated values.

This checkout contains version 2.1.0. npm publication is separate; build this revision from the repository root with npm ci and npm run build:packages.

import {
  generatePassword, generatePassphrase, generatePIN,
  generatePattern, generateCredential, calculateAudit,
} from '@poorvithmp/safegen';

const password = generatePassword({ length: 20 });
const options = { mode: 'passphrase' as const, words: 5, separator: '-' };
const phrase = generateCredential(options);
const audit = calculateAudit(phrase, options);
const pin = generatePIN({ pinLength: 6 });
const token = generatePattern({ template: 'Lnnn-Lnnn-S' });

| Function | Options and defaults | | --- | --- | | generatePassword / generateRandomPassword | length: 16; uppercase, lowercase, numbers, symbols all true. At least one character from each enabled set. Returns an empty string when all sets are disabled; rejects a length shorter than the set count. | | generatePassphrase | words / wordCount: 4; separator: '-'; capitalize: false; includeNumber: false. Number mode appends a random integer from 0 through 99 to a random word. | | generatePIN | pinLength takes precedence over length; default 6 digits. | | generatePattern | template / pattern: 'Lnnn-Lnnn-S'. L uppercase, l lowercase, n digit, S/s symbol; other characters are literal. | | generateCredential | Routes by mode: random, passphrase, pin or pattern. | | calculateAudit / calculateDetailedAudit | Accept the generated value and the same generator options. Returns entropy, rating, score, pool size, warnings, tips and a hypothetical cracking-time estimate. |

Lengths and word counts must be positive integers. Randomness failure is an error; there is no fallback to Math.random.

Interpreting an audit

Passphrase entropy is based on the bundled 7,776-word vocabulary (about 12.92 bits per independent word). Fixed capitalization and separators add no entropy. Random number mode adds the number and position choices. PIN and pattern estimates use their respective character pools; literal pattern characters add no entropy.

The random-password estimate uses the character classes present in the supplied value. It is a heuristic, not an exact measurement of the constrained generator's distribution, and cannot establish the strength of a human-chosen password. Always pass the generation options for passphrases and patterns.

score is on a 0–100 scale. rating is Weak, Medium, Strong or Very strong. timeToCrackSeconds is half the estimated search space at 100 billion guesses per second; crackTime and crackTimeFormatted describe that same assumption. Actual attack rates depend on password hashing, hardware and rate limits. This is not a safety guarantee.

Wordlist and license

Passphrases use the EFF Large Wordlist, copyright Electronic Frontier Foundation, under CC BY 3.0 US. The source's dice labels are omitted from the generated TypeScript array; the words are preserved. The rest of SafeGen is MIT licensed.