{"id":23174206,"url":"https://github.com/coursedesign/koa-middleware-multiplexer","last_synced_at":"2026-04-29T08:35:34.975Z","repository":{"id":52293377,"uuid":"239240606","full_name":"CourseDesign/koa-middleware-multiplexer","owner":"CourseDesign","description":"Multiplex Koa's middleware.","archived":false,"fork":false,"pushed_at":"2021-05-01T05:28:15.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T01:42:55.283Z","etag":null,"topics":["middleware","multiplexer","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/koa-middleware-multiplexer","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/CourseDesign.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-02-09T03:28:40.000Z","updated_at":"2021-05-01T05:28:18.000Z","dependencies_parsed_at":"2022-09-12T12:11:51.557Z","dependency_job_id":null,"html_url":"https://github.com/CourseDesign/koa-middleware-multiplexer","commit_stats":null,"previous_names":["kdpark0723/koa-middleware-multiplexer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CourseDesign/koa-middleware-multiplexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fkoa-middleware-multiplexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fkoa-middleware-multiplexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fkoa-middleware-multiplexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fkoa-middleware-multiplexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CourseDesign","download_url":"https://codeload.github.com/CourseDesign/koa-middleware-multiplexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fkoa-middleware-multiplexer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275067379,"owners_count":25399682,"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-09-14T02:00:10.474Z","response_time":75,"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":["middleware","multiplexer","npm","npm-package"],"created_at":"2024-12-18T05:19:36.079Z","updated_at":"2026-04-29T08:35:34.924Z","avatar_url":"https://github.com/CourseDesign.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koa Middleware Multiplexer\n\n![](https://img.shields.io/npm/dm/koa-middleware-multiplexer.png?style=flat-square)\n\n**Multiplex Koa's middleware.**\n\n​    \n\n## Install\n\n```shell\n$ npm i koa-middleware-multiplexer\n```\n\n​    \n\n## Usage\n\n```js\nconst multiplexer = require('koa-middleware-multiplexer');\n\nrouter.post('/user', multiplexer.multiplex(\n  (ctx) =\u003e ctx.query.type,\n  [\n    ['admin', signUpAdmin],\n    ['user', signUpUser],\n  ],\n));\n```\n\n​    \n\n### multiplex\n\n```js\nfunction multiplex(condition, functions, options = { errorHandler, checkExist: false })\n```\n\n​    \n\n### Error Handel\n\n```js\nfunction errorHandel(ctx, error) {\n  ctx.response.status = error.status || error.statusCode || 500;\n  ctx.response.body = { message: error.message || 'Undefined error' };\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoursedesign%2Fkoa-middleware-multiplexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoursedesign%2Fkoa-middleware-multiplexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoursedesign%2Fkoa-middleware-multiplexer/lists"}