{"id":18389700,"url":"https://github.com/danielwpz/crepecake-params","last_synced_at":"2025-06-22T05:39:42.552Z","repository":{"id":42665607,"uuid":"272129105","full_name":"danielwpz/crepecake-params","owner":"danielwpz","description":"Params schema validation middleware for crepecake","archived":false,"fork":false,"pushed_at":"2023-01-24T04:52:54.000Z","size":254,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:37:10.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/danielwpz.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":"2020-06-14T03:56:24.000Z","updated_at":"2021-02-19T08:18:19.000Z","dependencies_parsed_at":"2023-02-13T17:45:41.423Z","dependency_job_id":null,"html_url":"https://github.com/danielwpz/crepecake-params","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake-params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake-params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake-params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake-params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielwpz","download_url":"https://codeload.github.com/danielwpz/crepecake-params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248528938,"owners_count":21119403,"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-11-06T01:44:12.631Z","updated_at":"2025-04-12T06:30:07.645Z","avatar_url":"https://github.com/danielwpz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crepecake-params\nParams schema validation middleware for Crepecake, based on Joi\n\n## Introduction\nThis is a Koa/crepecake middleware which aims to:\n1. Provide a unified way for downstream middlewares to retrive request parameters\n2. Enable parameter schema validation\n\n## Reference\n- Joi: https://hapi.dev/module/joi/#introduction\n\n## Example\n```javascript\nconst Crepecake = require('crepecake')\nconst app = new Crepecake()\nconst params = require('crepecake-params')\nconst Joi = require('@hapi/joi')\nconst Router = Crepecake.Router\nconst route = new Router()\n\nconst getSchema = Joi.object({\n  name: Joi.string().required(),\n  test: Joi.boolean().default(false),\n  date: Joi.date().required()\n})\n\nroute.get('/', params(getSchema, { abortEarly: false }), async ctx =\u003e {\n  console.log(ctx.state.params)\n  return ctx.state.params\n})\n\napp.use(route)\n\napp.listen(8888)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fcrepecake-params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielwpz%2Fcrepecake-params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fcrepecake-params/lists"}