{"id":18467,"library":"koa-66","title":"koa-66","description":"Router middleware for Koa v2 that supports Express-like HTTP verb methods (get, post, put, delete, all), param middleware, automatic OPTIONS/HEAD responses, 501/405 status codes with headers, and a plugin system for injecting middleware via config objects. It allows mounting routers on paths, supports multiple middleware as arguments or arrays, and can throw errors with status codes. Version 1.0.1 is the latest stable release, targeting Node >= 4. Alternatives like koa-router are more actively maintained.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/menems/koa-66","tags":["javascript","koa","router","route","middleware","es2015","asyncFunctions"],"install":[{"cmd":"npm install koa-66","lang":"bash","label":"npm"},{"cmd":"yarn add koa-66","lang":"bash","label":"yarn"},{"cmd":"pnpm add koa-66","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses CommonJS and has no default ESM export; require() is required for version 1.x.","wrong":"import Router from 'koa-66'","symbol":"Router","correct":"const Router = require('koa-66')"},{"note":"Router is exported as module.exports = Router, so destructuring works the same as importing the whole module.","wrong":"const koa66 = require('koa-66'); const Router = koa66.default","symbol":"Router (as named export)","correct":"const { Router } = require('koa-66')"},{"note":"Router must be instantiated with new; calling without new will throw an error.","wrong":"const router = Router()","symbol":"Router (constructor)","correct":"const router = new Router()"}],"quickstart":{"code":"const Koa = require('koa');\nconst Router = require('koa-66');\nconst app = new Koa();\nconst router = new Router();\n\nrouter.get('/', async (ctx) => {\n  ctx.body = 'Hello World!';\n});\n\napp.use(router.routes());\napp.listen(3000);\n\n// Visit http://localhost:3000/ => Hello World!","lang":"javascript","description":"Creates a basic Koa app with a single GET route using koa-66 router."},"warnings":[{"fix":"Use `new Router()` instead of `Router()`.","message":"Router must be instantiated with `new`.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using koa-router or @koa/router which are actively maintained.","message":"The package has not been updated since 2016 and relies on Node >= 4. It may not be compatible with modern Koa v2 releases.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use `const Router = require('koa-66')` instead of `import Router from 'koa-66'`.","message":"No ESM support; only CommonJS require() works.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure `router.mount('/prefix', subRouter)` is used correctly.","message":"The `mount` method expects a path and a sub-router; passing incorrect arguments may cause silent failures.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Check that no other middleware sets ctx.state.plugins before using plugins.","message":"Plugin middleware uses `ctx.state.plugins` which may conflict with other Koa middleware.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `new Router()` instead of `Router()`.","cause":"Calling `Router()` without `new` when the package exports the constructor directly.","error":"Router is not a constructor"},{"fix":"Use `const Router = require('koa-66'); const router = new Router();`","cause":"Attempting to use `require('koa-66')` as a function (e.g., `require('koa-66')()`) instead of instantiating with new.","error":"require(...) is not a function"},{"fix":"Run `npm install koa-66` to install the package.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'koa-66'"},{"fix":"Ensure you create a new Router instance: `const router = new (require('koa-66'))()`","cause":"Variable `router` is not an instance of Router (e.g., it's the require() result).","error":"router.routes is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}