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 🙏

© 2024 – Pkg Stats / Ryan Hefner

password-helper

v1.1.0

Published

A highly customizable lightweight package that helps you check if password is a strong

Downloads

30

Readme

Password helper

Description

This lightweight npm package provides a utility for checking the strength of passwords based on various criteria such as presence of uppercase and lowercase characters, digits, special characters, and minimum length. It returns a detailed result object containing information about the password strength and any missing criteria.

Installation

To install the package, you can use npm:

npm install password-helper

Usage

import { strongPassword } from "password-helper";
const password = "YourPassword123!";
const config = {
  lowercase: true, // Default is true
  uppercase: true, // Default is true
  digit: true, // Default is true
  special_character: true, // Default is true
  minimum_length: 6, // Default is 6
};

const result = strongPassword(password, config);
console.log(result);

Parameters

  • password: The password string to be checked.
  • config: An optional configuration object allowing customization of password criteria. The available configuration options are:
  • lowercase: Boolean value indicating whether the password must contain lowercase characters. Default is true.
  • uppercase: Boolean value indicating whether the password must contain uppercase characters. Default is true.
  • digit: Boolean value indicating whether the password must contain digits. Default is true.
  • special_character: Boolean value indicating whether the password must contain special characters. Default is true.
  • minimum_length: Integer value indicating the minimum length of the password. Default is 6.

Return Value

The function strongPassword returns an object with the following properties:

  • password_missing: An array containing messages indicating which criteria the password is missing.
  • score: An integer representing the strength score of the password. The maximum score is 100.
  • strength: A string indicating the strength level of the password (e.g., "weak", "medium", "strong").

Example Output

{
password_missing: ["Password must contain an uppercase character [A - Z]"],
score: 80,
strength: "medium"
}

Credits

This npm package is maintained by Momoh yusuf.

License

This project is licensed under the MIT License. See the LICENSE file for details.