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

password-sheriff

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

password-sheriff

Password policy checker/enforcer.

0.4.0
Source
npm
Version published
Weekly downloads
37K
7.21%
Maintainers
1
Weekly downloads
 
Created
Source

Password Sheriff

Password policy enforcer.

Install

npm install password-sheriff

Usage

var createPolicy = require('password-sheriff');
var policy = createPolicy('good');

// Creates a password based on OWASP password recommendations
var policyOWASP = createPolicy('excellent');

// Displays the following password criteria:
// * 8 characters in length
// * contain at least 3 of the following 4 types of characters:
//  * lower case letters (a-z),
//  * upper case letters (A-Z),
//  * numbers (i.e. 0-9),
//  * special characters (e.g. !@#$%^&*)
console.log(policy.toString());

// returns false, it does not meet requirements
policy.check('hello');
policy.check('helloAD');

// returns true
policy.check('helloA1S2D1');

// asserts a password (throws an exception if invalid)
policy.assert('hello');

FAQs

Package last updated on 04 Nov 2014

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