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

passjen

v2.2.0

Published

Zero-dependency password generator and hasher.

Readme

PassJen

A Zero Dependency, secure password generator and hasher for TypeScript/JavaScript applications.

Features

  • 🔐 Generate secure passwords with customizable options
  • 🔒 Hash passwords using crypto's pbkdf2
  • ⚡ Synchronous and asynchronous methods
  • 🎯 Zero dependencies
  • 📊 Password strength assessment
  • 🛡️ Strict mode for guaranteed character inclusion
  • 🔄 Salt generation and management

Installation

npm install passjen

Usage

Password Generation

import { Generator } from 'passjen';

// Generate a password with default options
const result = Generator.generate({});
console.log(result.password); // 6-character password
console.log(result.passwordStrength); // Password strength rating

// Generate a strong password
const strongPassword = Generator.generate({
  characterLength: 12,
  useNumbers: true,
  useSymbols: true,
  useLowercase: true,
  useUppercase: true,
  useStrict: true
});

// Generate a password excluding similar characters
const unambiguousPassword = Generator.generate({
  characterLength: 10,
  useNumbers: true,
  useLowercase: true,
  excludeSimilarCharacters: true // Excludes i, l, 1, L, o, 0, etc.
});

Password Hashing

import { Hasher } from 'passjen';

// Async hashing
const hashedResult = await Hasher.hash('myPassword');
console.log(hashedResult.hashedPassword);
console.log(hashedResult.salt);

// Sync hashing
const hashedResultSync = Hasher.hashSync('myPassword');

// Password comparison (async)
const isMatch = await Hasher.compare({
  password: 'myPassword',
  hashedPassword: hashedResult.hashedPassword,
  salt: hashedResult.salt,
  saltRounds: hashedResult.saltRounds
});

// Generate and hash a password in one step
const generatedHash = await Hasher.generateHashedPassword({
  characterLength: 12,
  useNumbers: true,
  useSymbols: true,
  useLowercase: true,
  useUppercase: true,
  useStrict: true,
  saltRounds: 10
});

API Reference

Generator Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | characterLength | number | 6 | Length of the generated password | | useNumbers | boolean | false | Include numbers (0-9) | | useSymbols | boolean | false | Include symbols (!@#$%^&*()_+-=[]{}|;:,.<>?) | | useLowercase | boolean | false | Include lowercase letters (a-z) | | useUppercase | boolean | false | Include uppercase letters (A-Z) | | excludeSimilarCharacters | boolean | false | Exclude similar characters (ilLI|`oO0) | | excludeTheseCharacters | string | "" | Custom characters to exclude | | useStrict | boolean | false | Ensure at least one character from each selected type |

Password Strength Levels

The password strength is calculated based on:

  • Length (8+ chars for basic strength, 12+ for better strength)
  • Character variety (numbers, lowercase, uppercase, symbols)
  • Overall complexity

Strength levels:

  • Too weak: Very short or simple passwords
  • Weak: Longer passwords with limited character types
  • Medium: Medium-length passwords with some character types
  • Strong: Complex passwords with multiple character types and sufficient length

Hasher Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | saltRounds | number | 10 | Number of iterations for PBKDF2 | | encryption | string | "sha256" | Hash algorithm to use |

Security

PassJen uses Node's native crypto module with PBKDF2 for password hashing. The generator creates cryptographically secure random passwords when strict mode is enabled.

License

MIT License - see LICENSE file for details