{"id":17954694,"url":"https://github.com/nukeop/express-enum-param","last_synced_at":"2025-06-15T19:39:34.927Z","repository":{"id":91755024,"uuid":"161612162","full_name":"nukeop/express-enum-param","owner":"nukeop","description":"Middleware for ensuring that a request parameter can only assume certain values","archived":false,"fork":false,"pushed_at":"2018-12-13T09:15:21.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T06:36:21.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nukeop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-12-13T09:05:42.000Z","updated_at":"2018-12-13T09:15:23.000Z","dependencies_parsed_at":"2023-05-02T21:55:31.689Z","dependency_job_id":null,"html_url":"https://github.com/nukeop/express-enum-param","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"88a7b19b15f69abb91f1396d5ff524a962064915"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nukeop/express-enum-param","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukeop%2Fexpress-enum-param","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukeop%2Fexpress-enum-param/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukeop%2Fexpress-enum-param/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukeop%2Fexpress-enum-param/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nukeop","download_url":"https://codeload.github.com/nukeop/express-enum-param/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukeop%2Fexpress-enum-param/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260040383,"owners_count":22949813,"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","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":[],"created_at":"2024-10-29T10:19:30.498Z","updated_at":"2025-06-15T19:39:34.898Z","avatar_url":"https://github.com/nukeop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-enum-param\nMiddleware for ensuring that a request parameter can only assume certain values\n\n## Installation\n\n```shell\n$ npm install --save express-enum-param\n```\nRequires `body-parser`.\n\n## Usage\n```javascript\nimport enumParam from 'express-enum-param';\n\nlet allowedAnimals = ['crocodile', 'heron', 'turtle'];\n\nrouter.get('/', \n\tenumParam('animal', allowedAnimals),\n\t(req, res) =\u003e {\n    res.status(200).send();\n});\n```\n\nThe above code will return a 400 HTTP status code and a message informing the client that this parameter can only have values from a certain list if `animal` is anything else than `crocodile`, `heron`, or `turtle`.\n\n## About\n### License\nCopyright © 2018, [nukeop](https://github.com/nukeop).\nReleased under the [Affero GPL 3.0 License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukeop%2Fexpress-enum-param","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnukeop%2Fexpress-enum-param","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukeop%2Fexpress-enum-param/lists"}