{"id":16720171,"url":"https://github.com/hsynlms/node-with-allow","last_synced_at":"2025-08-25T07:15:57.995Z","repository":{"id":57398381,"uuid":"373146584","full_name":"hsynlms/node-with-allow","owner":"hsynlms","description":"A route handler wrapper for Express to check if the requested HTTP method are allowed for the route.","archived":false,"fork":false,"pushed_at":"2021-06-08T17:14:38.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T19:23:12.342Z","etag":null,"topics":["allow","express","handler","http-methods","nextjs","route"],"latest_commit_sha":null,"homepage":"","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/hsynlms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-02T11:40:50.000Z","updated_at":"2021-06-08T17:14:40.000Z","dependencies_parsed_at":"2022-08-29T15:20:56.200Z","dependency_job_id":null,"html_url":"https://github.com/hsynlms/node-with-allow","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hsynlms/node-with-allow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fnode-with-allow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fnode-with-allow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fnode-with-allow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fnode-with-allow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsynlms","download_url":"https://codeload.github.com/hsynlms/node-with-allow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsynlms%2Fnode-with-allow/sbom","scorecard":{"id":471038,"data":{"date":"2025-08-11","repo":{"name":"github.com/hsynlms/node-with-allow","commit":"f4709c52011c6b5e8bcaec0597dd68684ff56501"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/13 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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/hsynlms/node-with-allow/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/hsynlms/node-with-allow/main.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:22","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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"}}]},"last_synced_at":"2025-08-19T13:53:44.857Z","repository_id":57398381,"created_at":"2025-08-19T13:53:44.857Z","updated_at":"2025-08-19T13:53:44.857Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272022119,"owners_count":24860113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["allow","express","handler","http-methods","nextjs","route"],"created_at":"2024-10-12T22:06:05.817Z","updated_at":"2025-08-25T07:15:57.945Z","avatar_url":"https://github.com/hsynlms.png","language":"JavaScript","readme":"# withAllow\n\u003e A route handler wrapper for [Express](https://github.com/expressjs/express) to check if the requested HTTP method are allowed for the route.\n\n[![Downloads](https://img.shields.io/npm/dm/with-allow.svg)](https://npmjs.com/with-allow)\n[![install size](https://packagephobia.com/badge?p=with-allow)](https://packagephobia.com/result?p=with-allow)\n\n## Install\n```\n$ npm install with-allow --save\n```\n\n## Usage\n\n```js\nimport express from 'express'\nimport withAllow from 'with-allow'\n\nconst app = express()\n\nconst routeHandler =\n  (req, res) =\u003e {\n    res.send(`${req.method} works!`)\n  }\n\n// other HTTP method requests such as POST, PUT etc., will throw 405 HTTP error\napp.get('/', withAllow(routeHandler, ['GET']))\n\napp.listen(3000, () =\u003e {\n  console.log('Express server is running on port: 3000')\n})\n\n// http://localhost:3000 -\u003e will print out \"GET works!\"\n```\n\n## Next.js\n\nIt is also possible to use `withAllow` in [Next.js](https://github.com/vercel/next.js/) API routes. There is an example following.\n\n```js\n// Next.js API route example\nfunction handler(req, res) {\n  // API route handler\n}\n\nexport default withAllow(handler, ['POST'])\n```\n\n## Options\n\n| Name                   | Type              | Default        | Description                                                                    |\n| ---                    | ---               | ---            | ---                                                                            |\n| handler                | `function`        | -              | The original Express.js route handler                                          |\n| allowedMethods         | `string[]` or `*` | `[]`           | Allowed HTTP method list for the route handler. Left blank to disallow all the HTTP methods. Pass asterisk (*) to allow all the HTTP methods. |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsynlms%2Fnode-with-allow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsynlms%2Fnode-with-allow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsynlms%2Fnode-with-allow/lists"}