New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

check-password-strength

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-password-strength

Password strength checker based from Javascript RegExp

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Overview

A simple way to check that password strength of a certain passphrase. A password strength checker based from Javascript RegEx.

Installation

npm i check-password-strength --save

Setup & Basic Usage

const { passwordStrength } = require('check-password-strength')

console.log(passwordStrength('asdfasdf').value)
// Weak (It wiill return weak if the value doesn't match the RegEx conditions)

console.log(passwordStrength('Asdfasdf2020').value)
// Medium

console.log(passwordStrength('A@2asdF2020!!*').value)
// Strong

Additional Info

Object

PropertyDesc.
id0 = Weak, 1 = Medium & 2 = Strong
valueWeak, Medium & Strong
console.log(passwordStrength('Asdfasdf2020'))
// { id: 1, value: 'Weak' }

RegEx

Strong Password RegEx used:

^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})

Medium Password RegEx used:

^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"

RegExDesc.
^The password string will start this way
(?=.*[a-z])The string must contain at least 1 lowercase alphabetical character
(?=.*[A-Z])The string must contain at least 1 uppercase alphabetical character
(?=.*[0-9])The string must contain at least 1 numeric character
(?=.[!@#$%^&])The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict
(?=.{8,})The string must be eight characters or longer

Credits to Nic Raboy for his awesome blog!

Feel free to clone or fork this project: https://github.com/deanilvincent/check-password-strength.git

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

FAQs

Package last updated on 24 Jan 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc