Password Meter Pro is inspired by pointing system of Password Entropy, in which the main purpose is to help the end-users to have stronger passwords. (Password entropy is a measurement of how unpredictable a password is.)
Use the package manager npm to install Password Meter Pro.
npm i password-meter-pro
It's very easy to configure on your application. Just follow on below:
let app = require("password-meter-pro");
app.password_strength("1111") # return message = "Very Weak" , strength = 14 , percentage = 11%
app.password_strength("aaaa") # return message = "Very Weak" , strength = 19 , percentage = 15%
app.password_strength("####") # returns message = "Very Weak" , strength = 21 , percentage = 17%
app.password_strength("banglad") # returns message = "Weak" , strength = 33 , percentage = 26%
app.password_strength("bangla1") # returns message = "Good" , strength = 37 , percentage = 29%
app.password_strength("bangladesh") # returns message = "Good" , strength = 48 , percentage = 38%
app.password_strength("bangla1desh") # returns message = "Good" , strength = 57 , percentage = 45%
app.password_strength("Bangla1desh") # returns message = "Strong", strength = 66, percentage = 52%
app.password_strength("Bangladesh#") # returns message = "Strong", strength = 71, percentage = 56%
app.password_strength("Bangla1desh#") # returns message = "Strong", strength = 79, percentage = 62%
app.password_strength("Hello71*Bangla1desh#") # returns message = "Very Strong" , strength = 132 , percentage = 100%There are some default messages. If you need to configure your own message like "This Password is Very Weak" instead of "You should use strong password", you can do it easily here:
// Example: default messages of the package,
{
VERY_WEAK: "Very Weak",
WEAK: "Weak",
GOOD: "Good",
STRONG: "Strong",
VERY_STRONG: "Very Strong"
}You can override these messages by using the "message" method:
app.message({
VERY_WEAK: "You should use strong password",
});
app.password_strength("####") # returns 'You should use strong password'
//or
app.message({
VERY_WEAK: "You should use strong password",
}).password_strength("####") # returns 'You should use strong password'There are some default configurations for checking and validating items in the password. You can use the "config" method if you want to customise that too.
// Default configs
{
SMALL_LETTER : {
min: 0,
max: 26
},
CAPITAL_LETTER : {
min: 0,
max: 26
},
NUMERIC: {
min: 0,
max: 255
},
SPECIAL_CHAR: {
min: 0,
max: 33
}
}You can override these configs:
app.config({
// always checking the length of the given item of each type
NUMERIC: {
min: 2,
max: 6
},
});
app.password_strength("####") # returns 'Numeric letter must be min: 2 and max: 6'
//or
app.config({
NUMERIC: {
min: 2,
max: 6
}
}).password_strength("####") # returns 'Numeric letter must be min: 2 and max: 6'Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.