{"id":41857232,"url":"https://github.com/scopdrag/express-validators","last_synced_at":"2026-01-25T11:03:30.306Z","repository":{"id":143878998,"uuid":"68531559","full_name":"scopdrag/express-validators","owner":"scopdrag","description":"Express framework json object(req) validator.","archived":false,"fork":false,"pushed_at":"2025-06-12T05:47:31.000Z","size":29,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-23T23:53:04.199Z","etag":null,"topics":["bluebird-promise","expressjs","json","promise"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scopdrag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-18T15:58:11.000Z","updated_at":"2022-08-08T19:13:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba47a6dd-69e1-4ff9-8279-eb2688374ead","html_url":"https://github.com/scopdrag/express-validators","commit_stats":null,"previous_names":["scopdrag/validator"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/scopdrag/express-validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scopdrag%2Fexpress-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scopdrag%2Fexpress-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scopdrag%2Fexpress-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scopdrag%2Fexpress-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scopdrag","download_url":"https://codeload.github.com/scopdrag/express-validators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scopdrag%2Fexpress-validators/sbom","scorecard":{"id":805273,"data":{"date":"2025-08-11","repo":{"name":"github.com/scopdrag/express-validators","commit":"cbf8a7f3b3ee214fdf68ff30ad9cc42c3dcb9003"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T11:36:23.604Z","repository_id":143878998,"created_at":"2025-08-23T11:36:23.604Z","updated_at":"2025-08-23T11:36:23.604Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28752380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluebird-promise","expressjs","json","promise"],"created_at":"2026-01-25T11:03:29.284Z","updated_at":"2026-01-25T11:03:30.293Z","avatar_url":"https://github.com/scopdrag.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# validator-for-express\n\n[![npm](https://img.shields.io/npm/v/express-validators.svg?maxAge=2592000)](https://www.npmjs.com/package/express-validators)\n[![npm](https://img.shields.io/npm/dm/express-validators.svg?maxAge=2592000)](https://www.npmjs.com/package/express-validators)\n[![npm](https://img.shields.io/npm/dt/express-validators.svg?maxAge=2592000)](https://www.npmjs.com/package/express-validators)\n[![npm](https://img.shields.io/npm/l/express-validators.svg?maxAge=2592000)](https://www.npmjs.com/package/express-validators)\n\n\u003ca href=\"https://nodei.co/npm/express-validators/\"\u003e\u003cimg src=\"https://nodei.co/npm/express-validators.png?downloads=true\u0026downloadRank=true\u0026stars=true\"\u003e\u003c/a\u003e\n\nNodejs (Express js) server side Validator.\nThis package offer very simple and easy way to validate any type of json object (request json object) for expressjs.\nThis validator also work with bluebird promise as well as async method callback.\nExpressjs framework json object(request) validator package. \n\n\n Install using NPM\n```bash\nnpm i validator-for-express --save\n```\n require in your (expressjs) route file.\n```javascript\nvar Validators = require('validator-for-express')\n```\n\nor if you using bluebird promise\n\n```javascript\nvar Promise = require('bluebird');\nvar Validators = require('validator-for-express');\nPromise.promisifyAll(Validators);\n```\n\nOr\n\n```javascript\n\nvar Validators = Promise.promisifyAll(require('validator-for-express'));\n```\n\n\n## Usage\n\n e.g: Json object need to be validated.\n\n```javascript\n\n    var Obj = {\n        currentDate: '2016-09-16',\n        afterDate: '2016-09-17',\n        beforeDateValue: '2016-09-18',\n        alphaValue: 12112,\n        alpha_numValue: 'test_1-2',\n        arrayValue: [],\n        betweenValue: 40,\n        booleanValue: true,\n        confirmedValue: \"233232\",\n        confirmedValue1: \"233232ss\",\n        dateValue: \"2015-03-25ss\",\n        notEqualValue: 12112,\n        numericValue: \"12112ss\",\n        lengthValue: \"12112ss\",\n        emailValue: \"12112ss@gmail.com\",\n        inValue: \"23\",\n        ipValue: \"23\",\n        notInValue: \"23\", \n        regexValue: \"\",\n        requiredValue: \"\",\n        requiredIfValue: \"\",\n        stringValue: 7797,\n        urlValue: 7797,\n        amountValue: \"7797.00ss\" \n    };\n\n```\n\n\n You can specify the rules for each index in json object. also you can specify multiple rules for a particular index by adding \"|\" after first rule.\n\n```javascript\n\n    var rules = {\n        \"currentDate\": \"after:afterDate|date\",\n        \"beforeDateValue\": \"before:afterDate\",\n        \"alphaValue\": \"alpha\",\n        \"alpha_numValue\": \"alpha_num\",\n        \"arrayValue\": \"array\",\n        \"betweenValue\": \"between:10,30\",\n        \"booleanValue\": \"boolean\",\n        \"confirmedValue\": \"confirmed:confirmedValue1\",\n        \"dateValue\": \"date\",\n        \"notEqualValue\": \"notEqual:alphaValue\",\n        \"numericValue\": \"numeric\",\n        \"lengthValue\": \"length:10,30\",\n        \"inValue\": \"in:23,34\",\n        \"ipValue\": \"ip\",\n        \"notInValue\": \"notIn:23,35\",\n        \"issetValue\": \"isset\",\n        \"regexValue\": \"regex:pattern\",\n        \"requiredValue\": \"required\",\n        \"requiredIfValue\": \"requiredIf:alphaValue,12112\",\n        \"stringValue\": \"string\",\n        \"urlValue\": \"url\",\n        \"amountValue\": \"amount\"\n    };\n    \n```\n\n You can define messages for each rule of an index. if don't specify the messages it will return default messages. It is not mendatory.\n\n\n```javascript\n\n    var messages = {\n        emailValue:{\n            email: \"Please enter a valid email address.\"\n        }\n    };\n```\n\n\n Call to validator meathod\n\n```javascript\n\n    Validators.validator(Obj, rules, messages, function (err, validated) {\n         \n          if (validated.fails) { \n              console.log(validated.getErrors)\n          }\n    })\n```\nOr If using promise.\n\n```javascript\nValidators.validatorAsync(Obj, rules, messages)\n            .then(function (validated) {\n                   if (validated.fails) { \n                      console.log(validated.getErrors)\n                  }\n            })\n            .catch(function(err){\n              console.error(err);\n            })\n```\n`fails` index will be true if there is an error. Otherwise it will be false.\n`getErrors` index contains error field as a key and array of error messages for that field.\n\ne.g: \n\n```javascript\n\n{ currentDate: [ 'CurrentDate must be later date then afterDate' ],\n  beforeDateValue: [ 'BeforeDateValue must be before date then afterDate' ],\n  alphaValue: [ 'AlphaValue must be entirely alphabetic characters.' ],\n  alpha_numValue: [ 'Alpha numValue must be alpha-numeric characters.' ],\n  betweenValue: [ 'BetweenValue value must be in 10,30' ],\n  confirmedValue: [ 'ConfirmedValue value must be same as ConfirmedValue1' ],\n  dateValue: [ 'DateValue must be a valid date.' ],\n  notEqualValue: [ 'NotEqualValue value must not be equal to AlphaValue' ],\n  numericValue: [ 'NumericValue must be a numeric value.' ],\n  lengthValue: [ 'LengthValue should be 10 to 30 character long.' ],\n  emailValue: [ 'Please enter a valid email address.' ],\n  ipValue: [ 'IpValue must be a valid ip address.' ],\n  notInValue: [ 'NotInValue must not be in 23,35.' ],\n  issetValue: [ 'IssetValue does not exists.' ],\n  regexValue: [ 'RegexValue found to be in invalid pattern.' ],\n  requiredValue: [ 'RequiredValue field is required.' ],\n  requiredIfValue: [ 'RequiredIfValue field is required.' ],\n  stringValue: [ 'StringValue must be a string.' ],\n  urlValue: [ 'UrlValue must be a valid url.' ],\n  amountValue: [ 'AmountValue must be an amount value.' ] }\n  \n```  \n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscopdrag%2Fexpress-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscopdrag%2Fexpress-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscopdrag%2Fexpress-validators/lists"}