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

p-meter

v2.1.0

Published

A measure of the strength of the password for node js developer 📏 ..

Downloads

20

Readme

P-METER 📏

pMeter

Build Status   Coverage Status

quick way to measure the strength of the password.

The purpose of this module is to analyze the password and then categorize it according to our rules mentioned in the documentation where you can view the result numerical or textual.

NOTE: we verify that a blank password or that there are spaces are passed to the module function.

Installation

# npm
$ npm install p-meter
# yarn
$ yarn add p-meter

Usage

const pwdMeter = require('p-meter')
const password = '199812+imeD'
// 1.x.x
// const result = pwdMeter (password, { displayString: true, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false 
const result = pwdMeter (password, { displayString: true })

NOTE: This example is the simplest thing to write. For more examples you will find them in a section of exemples.

Examples

The result can be displayed in a two different way (Numerical or Textual). In this section we illustrate the two ways of seeing the result.

1- Numerical:

| -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | |----|---|---|---|---|---|---|---|

// 1.x.x 
const result = passwordMeter(password, { displayString: false, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false
const result = passwordMeter(password)

2 - Textual :

| ERROR | FAIBLE | AVG | ABOVE AVG | STRONG AVG | FORT | ABOVE FORT | STRONG FORT | |-------|--------|-----|-----------|------------|------|------------|-------------|

// 1.x.x
const result = passwordMeter(password, { displayString: true, useSpace: false })
// 2.x.x
// the default value of displayString and useSpace is false
const result = passwordMeter(password, { displayString: true })

Rules

We can divide passwords into four categories (numbers, uppercase alphabet, lowercase alphabet and special characters) ..

We have 8 levels of results:

  • Level 1 (-1 or ERROR): If you have an invalid password that is empty or composed of spaces.
  • Level 2 (0 or LOW): If there is only one category in the password of the four.
  • Level 3 (1 or AVG): if there are two categories in the password and the special characters do not belong to them.
  • Level 4 (2 or ABOVE AVG): if there are two categories in the password and the special characters belong to it.
  • Level 5 (3 or STRONG AVG): If you have three categories and the special characters do not belong to them.
  • Level 6 (4 or FORT): If you have three categories and the special characters belong to them.
  • Level 7 (5 or ABOVE FORT): if all categories are present.
  • Level 8 (6 or STRONG FORT): If all categories are present with the following characteristics:
    • If uppercase letters are at least 30% of the password length, lowercase letters must be at least 10%.
    • If lowercase letters represent 30% of the length of the password, the capital letters must represent at least 10%.
    • Special characters must be at least 20%.

License


MIT