{"id":29326277,"url":"https://github.com/armenhajian/koa2-validate","last_synced_at":"2026-05-18T00:33:08.342Z","repository":{"id":57289499,"uuid":"166414311","full_name":"armenhajian/koa2-validate","owner":"armenhajian","description":"Request params validator for koa.js","archived":false,"fork":false,"pushed_at":"2019-01-21T09:15:20.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-17T09:49:01.935Z","etag":null,"topics":["koa2","koa2-validate","validatorjs"],"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/armenhajian.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}},"created_at":"2019-01-18T14:05:40.000Z","updated_at":"2020-04-06T20:58:57.000Z","dependencies_parsed_at":"2022-09-20T09:01:58.382Z","dependency_job_id":null,"html_url":"https://github.com/armenhajian/koa2-validate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/armenhajian/koa2-validate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armenhajian%2Fkoa2-validate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armenhajian%2Fkoa2-validate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armenhajian%2Fkoa2-validate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armenhajian%2Fkoa2-validate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armenhajian","download_url":"https://codeload.github.com/armenhajian/koa2-validate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armenhajian%2Fkoa2-validate/sbom","scorecard":{"id":207555,"data":{"date":"2025-08-11","repo":{"name":"github.com/armenhajian/koa2-validate","commit":"9507c0414493c086188baea7d4d20273ab83c2e8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/3 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":"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":"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":"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":"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":"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 '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":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5"],"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-17T00:06:36.370Z","repository_id":57289499,"created_at":"2025-08-17T00:06:36.370Z","updated_at":"2025-08-17T00:06:36.370Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: 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":["koa2","koa2-validate","validatorjs"],"created_at":"2025-07-07T19:01:29.775Z","updated_at":"2026-05-18T00:33:08.337Z","avatar_url":"https://github.com/armenhajian.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa2-validate\n\n[![Build Status](https://img.shields.io/npm/v/koa2-validate.svg)](https://www.npmjs.com/package/koa2-validate)\n\nA library that wrap [validator.js][vldtr.git] package for koa.js to validate request parameters.\n\n### Installation and usage\n\nThe lib requires [Koa.js](https://koajs.com/) to run.\n\n\n```sh\n$ npm install koa2-validate\n```\n\n#### No ES6\n\n```javascript\nvar validate = require('koa2-validate');\n```\n\n#### ES6\n\n```javascript\nimport validate from 'koa2-validate';\n```\n##### Usage example\n#\n```javascript\nconst app = new Koa()\n  .use(cors())\n  .use(bodyParser())\n  .use(validate()) //use before api routes!!\n  .use(api.routes())\n  \n\n/**\nUse as {param: 'required|methodNameWithoutPrefix'}\n*/\napi.get('/simple-list',\n  async (ctx, next) =\u003e {\n    ctx.validate({\n      limit: 'required|numeric^{no_symbols: true}',\n      page: 'required|numeric^{no_symbols: true}'\n    })\n})\n```\n\nThe `|` symbol is a separator for rules.\\\nOnly `required` is build-in rule.\\\nFor other rules use method name from the Validate.js [validators][vldrs-link] which STARTS with `is` prefix.\\\nFor example if you write `'..|numeric'` it will call `isNumeric` method from `Validate.js` lib. \u0026nbsp;\nFor options you can use `^{}`.\\\ne.g. if you want to call `isNumeric(myVar, {no_symbols: true})` then use `..|numeric^{no_symbols: true}`\n\nIf the params not pass the rules it will respond with `422` status and error text `${key} should be ${rule}`\n\n#### ToDo\n- Make error texts more dynamic (maybe with option to pass from code)\n- Add support of methods without `is` prefix\n- Write tests\n\nLicense\n----\n\nMIT\n\n\n[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks to amazing https://dillinger.io builder)\n\n\n   [vldtr.npm]: \u003chttps://www.npmjs.com/package/validator\u003e\n   [vldtr.git]: \u003chttps://github.com/chriso/validator.js\u003e\n   [vldrs-link]: \u003chttps://github.com/chriso/validator.js#validators\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmenhajian%2Fkoa2-validate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmenhajian%2Fkoa2-validate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmenhajian%2Fkoa2-validate/lists"}