{"id":13989611,"url":"https://github.com/eggjs/koa-express-adapter","last_synced_at":"2025-10-14T14:17:30.227Z","repository":{"id":66078630,"uuid":"170899725","full_name":"eggjs/koa-express-adapter","owner":"eggjs","description":"The adapter for the migration from express to koa","archived":false,"fork":false,"pushed_at":"2019-02-18T07:38:20.000Z","size":23,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-17T12:46:27.930Z","etag":null,"topics":["express","koa"],"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/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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}},"created_at":"2019-02-15T17:03:21.000Z","updated_at":"2022-02-08T06:51:17.000Z","dependencies_parsed_at":"2023-03-26T17:18:22.591Z","dependency_job_id":null,"html_url":"https://github.com/eggjs/koa-express-adapter","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"60d1ccc92ca2cb914d11ee1680fcc76a8e07bd11"},"previous_names":["popomore/koa-express-adapter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eggjs/koa-express-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fkoa-express-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fkoa-express-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fkoa-express-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fkoa-express-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/koa-express-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fkoa-express-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019181,"owners_count":26086576,"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-10-14T02:00:06.444Z","response_time":60,"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":["express","koa"],"created_at":"2024-08-09T13:01:50.843Z","updated_at":"2025-10-14T14:17:30.209Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# The adapter for the migration from express to koa\n\nIf you have search the two framework on npm, you will get 16k+ (express) and 4k+ (koa). express has a bigger ecosystem than koa, This package will let you use express middleware in koa application.\n\n## Badges\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/koa-express-adapter.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-express-adapter\n[travis-image]: https://img.shields.io/travis/popomore/koa-express-adapter.svg?style=flat-square\n[travis-url]: https://travis-ci.org/popomore/koa-express-adapter\n[codecov-image]: https://codecov.io/gh/popomore/koa-express-adapter/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/popomore/koa-express-adapter\n[download-image]: https://img.shields.io/npm/dm/koa-express-adapter.svg?style=flat-square\n[download-url]: https://npmjs.org/package/koa-express-adapter\n\n## Usage\n\nYou can simply wrap express middleware with `wrap` function.\n\n```js\nconst { wrap } = require('koa-express-adapter');\nconst Koa = require('koa');\nconst app = new Koa();\n// wrap express middleware\napp.use(wrap(function(req, res) {\n  res.send('Hello World');\n}));\n```\n\n**Note: Don't define next argument when you don't use it.**\n\n```js\n// it's wrong\napp.use(wrap(function(req, res, next) {\n  res.send('Hello World');\n}));\n```\n\n## Express API\n\n### Request\n\n- [x] accepts\n- [x] acceptsCharset\n- [x] acceptsCharsets\n- [x] acceptsEncoding\n- [x] acceptsEncodings\n- [x] acceptsLanguage\n- [x] acceptsLanguages\n- [ ] baseUrl\n- [ ] fresh\n- [x] get\n- [x] hostname\n- [x] host\n- [x] ip\n- [x] ips\n- [x] is\n- [ ] param\n- [x] path\n- [x] protocol\n- [x] query\n- [ ] range\n- [ ] route\n- [ ] secure\n- [ ] signedCookies\n- [ ] stale\n- [ ] subdomains\n- [ ] xhr\n\n### Response\n\n- [ ] append\n- [x] attachment\n- [x] clearCookie\n- [x] cookie\n- [ ] download\n- [ ] format\n- [x] get\n- [x] json\n- [ ] jsonp\n- [ ] links\n- [x] locals\n- [x] location\n- [x] redirect\n- [ ] render\n- [x] send\n- [ ] sendFile\n- [x] sendStatus\n- [x] set\n- [x] status\n- [x] type\n- [x] vary\n\n## Testcase\n\nThanks for [express testcase](https://github.com/popomore/koa-express-adapter/tree/first/test/express) for compatible unittest.\n\n## License\n\n(The MIT License)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fkoa-express-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fkoa-express-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fkoa-express-adapter/lists"}