![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@netsells/password-validator
Advanced tools
Validates password according to flexible and intuitive specifications
npm install password-validator
var passwordValidator = require('password-validator');
// Create a schema
var schema = new passwordValidator();
// Add properties to it
schema
.is().min(8) // Minimum length 8
.is().max(100) // Maximum length 100
.has().uppercase() // Must have uppercase letters
.has().lowercase() // Must have lowercase letters
.has().digits() // Must have digits
.has().not().spaces() // Should not have spaces
.is().not().oneOf(['Passw0rd', 'Password123']); // Blacklist these values
// Validate against a password string
console.log(schema.validate('validPASS123'));
// => true
console.log(schema.validate('invalidPASS'));
// => false
// Get a full list of rules which failed
console.log(schema.validate('joke', { list: true }));
// => [ 'min', 'uppercase', 'digits' ]
Rules supported as of now are:
Rules | Descriptions |
---|---|
digits() | specifies password must include digits |
letters() | specifies password must include letters |
lowercase() | specifies password must include lowercase letters |
uppercase() | specifies password must include uppercase letters |
symbols() | specifies password must include symbols |
spaces() | specifies password must include spaces |
min(len) | specifies minimum length |
max(len) | specifies maximum length |
oneOf(list) | specifies the whitelisted values |
not([regex]) | inverts the result of validations applied next |
is() | inverts the effect of not() |
has([regex]) | inverts the effect of not() and applies a regex (optional) |
The following options can be passed to validate
method:
list
- If set, validate method returns a list of rules which failed instead of true/false.For APIs of other older versions, head to Wiki.
FAQs
Validates password according to flexible and intuitive specifications
We found that @netsells/password-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.