New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pass-utils

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pass-utils

> Secure, customizable password generator for Node.js — supports complexity rules, exclusions, and bulk generation.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

🔐 pass-utils

Secure, customizable password generator for Node.js — supports complexity rules, exclusions, and bulk generation.

npm version License

Features

  • ✅ Fully customizable password composition
  • ✅ Specify minimum requirements (uppercase, lowercase, numbers, symbols)
  • ✅ Exclude similar or specific characters
  • ✅ Generate one or multiple passwords
  • ✅ Uses crypto.getRandomValues() for secure randomness
  • ✅ Zero dependencies

Installation

npm install pass-utils

Usage

const { generatePassword } = require("pass-utils");

const password = generatePassword(16, {
  uppercase: true,
  lowercase: true,
  numbers: true,
  symbols: true,
  similar: false,
  exclude: "aeiou",
}, {
  minUpper: 2,
  minLower: 4,
  minNumbers: 2,
  minSymbols: 2,
});

console.log(password); // Output: "Kf#7gR!cP2xMbL9q"

Generating multiple passwords

const { generateMultiplePasswords } = require("pass-utils");

const passwords = generateMultiplePasswords(5, 12, {
  symbols: false,
  similar: true,
}, {
  minUpper: 1,
  minLower: 3,
  minNumbers: 2,
});

console.log(passwords);
/*
Output:
[
  'gZ0rWx8BkpAf',
  'uzhB3yDA0wkd',
  'MkwbpZ08uhxy',
  '2WyuDfR6vhga',
  '3bHJw96zFqmt'
]
*/

API

generatePassword(length, options?, requirements?)

ParameterTypeDescription
lengthnumberLength of the generated password
optionsobjectOptional settings for character types and exclusions (default: all enabled)
requirementsobjectOptional requirements for minimum characters per type

Options object

ParameterTypeDefaultDescription
uppercasebooleantrueInclude uppercase letters
lowercasebooleantrueInclude lowercase letters
numbersbooleantrueInclude numbers
symbolsbooleantrueInclude special characters
similarbooleantrueAllow similar-looking characters (like O, 0, l, 1)
excludestring""Custom string of characters to exclude

Requirements object

KeyTypeDefaultDescription
minUppernumber0Minimum number of uppercase characters
minLowernumber0Minimum number of lowercase characters
minNumbersnumber0Minimum number of numeric characters
minSymbolsnumber0Minimum number of special characters

FAQs

Package last updated on 09 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts