Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

validate-password

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validate-password

Strengthen your user's passwords

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
336
increased by18.73%
Maintainers
1
Weekly downloads
 
Created
Source

#JavaScript Password validation for the client and the server

Enforce stronger passwords for users by checking for uppercase/lowercase letters, numbers, and special characters.

You can also check passwords for certain strings. This is ideal for preventing users from entering their name or email in the password. Or, you can search the password for common words, to further encourage the user to pick a strong password.

##Installation Install via NPM:

npm install validate-password

##Usage

This can be used as a stand alone package:

<script src="node_modules/validate-password/dist/validate-password.min.js"></script>

or as a CommonJS module:

var ValidatePassword = require('validate-password');

Validate Password will accept two arguments - first, the password as a string:

var passwordData = ValidatePassword('aaaaa');

console.log(passwordData.isValid); // false
console.log(passwordData.validationMessage); // 'The password must contain at least one uppercase letter'

And, optionally, an array of strings that are not allowed to be in the password:

var checkPasswordForName = ValidatePassword('cat123aaBa$%^#$%#$%', ['cat123']);

console.log(passwordData.isValid); // false
console.log(passwordData.validationMessage); // 'The password cannot contain cat123'

See the examples directory for more detailed use cases...

FAQs

Package last updated on 25 Mar 2016

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