安装 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 )