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

all-str-gen

v3.0.2

Published

Generate passwords, usernames, recovery codes, patterns, tokens, PINs and passphrases with cryptographic randomness and zero dependencies.

Readme

all-str-gen

Passwords, usernames, tokens, codes and more — all in one package.

all-str-gen provides simple generators for common application needs, with configurable options and secure random generation using Node.js built-in cryptographic randomness.

Zero runtime dependencies · TypeScript support · CommonJS + ESM

Install

npm install all-str-gen

Quick Start

CommonJS

const gen = require('all-str-gen');

console.log(gen.generatePassword());
console.log(gen.generateUsername());
console.log(gen.generatePIN());
console.log(gen.generateUUID());

ES Modules

import gen from 'all-str-gen';

console.log(gen.generatePassword());
console.log(gen.generateUsername());
console.log(gen.generatePIN());
console.log(gen.generateUUID());

Generators

| Function | Description | | ----------------------------- | ----------------------------- | | generatePassword() | Secure customizable passwords | | generateUsername() | Random usernames | | generateRecoveryCodes() | Recovery/security codes | | generatePattern() | Custom formatted strings | | generateAlphanumericToken() | Letters and numbers | | generateNumericToken() | Numeric tokens | | generateAlphabeticToken() | Alphabetic tokens | | generateToken() | Random byte-based tokens | | generatePIN() | Numeric PINs | | generatePassphrase() | Random word-based passphrases | | generateString() | Custom random strings | | generateUUID() | UUID v4 identifiers | | generateNumber() | Random numbers within a range | | generateHash() | SHA-256 hashes |

Examples

Password

gen.generatePassword({
  length: 24,
  excludeSimilar: true
});

Username

gen.generateUsername({
  prefix: 'player_',
  digits: 4
});

Recovery Codes

gen.generateRecoveryCodes({
  count: 5
});

Custom Pattern

gen.generatePattern('ORDER-{upper:3}-{digit:6}');

// Example: ORDER-KQM-048291

Token

gen.generateToken({
  type: 'alphanumeric',
  length: 32
});

Passphrase

gen.generatePassphrase(6);

TypeScript

TypeScript declarations are included:

import {
  generatePassword,
  generateUUID
} from 'all-str-gen';

const password = generatePassword({
  length: 24
});

const id = generateUUID();

Requirements

  • Node.js 22 or newer
  • Node.js environment (not intended for browsers)

Security

Generators use Node.js cryptographic randomness where appropriate. Random output does not guarantee global uniqueness, so applications requiring unique values should enforce uniqueness when storing them.

Do not use generated hashes for password storage. Use a dedicated password-hashing algorithm instead.

License

MIT