纯验证器基于chriso的,但通过比较类型改进它,你可以在nodejs中使用安装npm install pure-validator用法var validator = require('pure-validator'); validator.isEmail('foo@bar.com'); //=> true #### customValidators var rules = { isDate: { fn: function(value) { return validator.matches(value, /^(19|20)[0-9]{2}[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/); }, message: 'Must be formatted as 1900-01