{"id":43604312,"url":"https://github.com/bolenge/body-data-validator","last_synced_at":"2026-02-04T06:14:04.071Z","repository":{"id":105954491,"uuid":"332551217","full_name":"bolenge/body-data-validator","owner":"bolenge","description":"JavaScript module (NodeJS) managing form inputs validation","archived":false,"fork":false,"pushed_at":"2022-06-22T15:35:20.000Z","size":55,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T22:43:11.835Z","etag":null,"topics":["express","form-validation","input-validation","javascript","nodejs","validation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bolenge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-01-24T20:41:39.000Z","updated_at":"2022-06-22T15:37:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b9e2895-e414-49c1-93aa-c0338579f175","html_url":"https://github.com/bolenge/body-data-validator","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"c23c9663f7e2aace26470ac9dc7ca24eec7d7272"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bolenge/body-data-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolenge%2Fbody-data-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolenge%2Fbody-data-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolenge%2Fbody-data-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolenge%2Fbody-data-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bolenge","download_url":"https://codeload.github.com/bolenge/body-data-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bolenge%2Fbody-data-validator/sbom","scorecard":{"id":247236,"data":{"date":"2025-08-11","repo":{"name":"github.com/bolenge/body-data-validator","commit":"c23c9663f7e2aace26470ac9dc7ca24eec7d7272"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/22 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 'main'"],"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":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T07:49:08.124Z","repository_id":105954491,"created_at":"2025-08-17T07:49:08.124Z","updated_at":"2025-08-17T07:49:08.124Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29072893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"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":["express","form-validation","input-validation","javascript","nodejs","validation"],"created_at":"2026-02-04T06:14:03.456Z","updated_at":"2026-02-04T06:14:04.064Z","avatar_url":"https://github.com/bolenge.png","language":"JavaScript","readme":"## body-data-validator\n\nIt is a JavaScript module (NodeJS) managing form inputs validation\n\n### Installation\n\nThis is a [Node.js] (https://nodejs.org/en/) module available at [npm registry] (https://www.npmjs.com/).\n\n```bash\n$ npm install body-data-validator\n```\n\n### API\n\nOnce you have it installed, you should now call the initialization middleware.\nIn case you are using [Express] (https://www.npmjs.com/package/express) you can insert it as below:\n\n```js\nconst express = require('express');\nconst bodyParser = require('body-parser');\nconst validator = require('body-data-validator');\n\nconst app = express();\n\napp.use(bodyParser.json());\n// From here\napp.use(validator.init);\n\napp.post('/api/users/create', (req, res, next) =\u003e {\n    // \n})\n\napp.listen(3000)\n```\n\nAfter adding the initialization middleware, the `validator` adds to the req.body object a method called `verify` (`req.body.verify`) which receives two parameters.\n\n```js\nlet rules = {\n\tname: 'required|min:3|max:30',\n\tfirstname: 'min:3|max:30',\n\temail: 'required|email'\n}\n\nreq.body.verify(rules, (valid, errors) =\u003e {\n\tif (valid) {\n\t\tconsole.log(\"Ok\")\n\t}else {\n\t\tconsole.log(errors)\n\t}\n})\n```\n\n#### validator.verify (rules, callback)\n\nThis method is the one which launches all the monoworks, it receives 2 parameters:\n\n1. `rules` the rules on the data elements to check for validity.\n2. `callback (valid, errorrs)` The second parameter is the callback function to be called, which in return receives two parameters.\n* `valid`: Equals` true` if everything is correct and there is no error and `false` otherwise\n* `errors`: Object, containing the list of errors whose key name is the name of the data and the value is the error message (`errors.name`)\n\n#### The available rules\n\n* `required`: The field is required, mandatory\n* `email`: The value of the field must be a valid email address\n* `min: n`:` n` represents the minimum number of characters this field must have\n* `max: n`:` n` represents the maximum number of characters this field must have\n* `int`: The value of chmap must be an integer\n* `alpha: n`: The value of the chmap must be a string` n` (optional) represents the number of characters this field must have\n* `tel`: The value of the field must be a valid phone number\n\n\u003e Note: In case you need to ensure that the name of the field to display the message to the user is not that of the sent data field, you can specify this name by adding the rule `field: Name to display`.\n\nExample\n```js\nlet rules = {\n\tname: 'field:Nom|required|min:3|max:30',\n\tfirstname: 'min:3|field:Prénom|max:30|alpha',\n\temail: 'required|email|field:Adresse email'\n}\n\nreq.body.verify(rules, (valid, errors) =\u003e {\n\tif (valid) {\n\t\tconsole.log(\"Ok\")\n\t}else {\n\t\tconsole.log(errors)\n\t}\n})\n```\n\n### Roadmap\n\n\u003ca href=\"https://trello.com/invite/b/FJxAzsc6/ebc27d25fd036bb93e5e0105721c295d/body-data-validator\" target=\"_blank\"\u003eClick here\u003c/a\u003e to open the new features roadmap\n\n#### Features\n\n* Add the validation rule of a File field, with the possibility of specifying the type of file\n* Ability to add your own validation rules\n* Integration of the i18n system of error messages\n\n[@bolenge](https://github.com/bolenge)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolenge%2Fbody-data-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbolenge%2Fbody-data-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbolenge%2Fbody-data-validator/lists"}