Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa2-router

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa2-router - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

4

package.json
{
"name": "koa2-router",
"version": "1.1.2",
"version": "1.2.0",
"description": "A express-liked router component for koa2",
"main": "index.js",
"types": "types.d.ts",
"repository": "xinpianchang/koa2-router",

@@ -31,2 +32,3 @@ "author": "Tang Ye <develop@xinpianchang.com>",

"devDependencies": {
"@types/koa": "^2.0.49",
"delay": "^4.1.0",

@@ -33,0 +35,0 @@ "http-errors": "^1.7.2",

@@ -177,19 +177,19 @@ # koa2-router

### Context
* ctx.baseUrl
* ctx.url
* ctx.params
* ctx.matched
* ctx.responded
* ctx.baseUrl: string
* ctx.url: string
* ctx.params: any
* ctx.matched: string[]
* ctx.responded: boolean
### Router
* class Router(name: String | opts: Object):(ctx, next) => void
* router.use([path: String | String[]], ...middlewares: (ctx, next) => void):Router
* router.route(path: String | String[]):Route
* router.all([path: String | String[]], ...middlewares: (ctx, next) => void):Router
* router[method]([path: String | String[]], ...middlewares: (ctx, next) => void):Router
* router.params(name: String, callback: (ctx, next, value, name) => void):Router
* class Router(name: string | opts: any):Middleware
* router.use([path: string | string[]], ...middlewares: Middleware):Router
* router.route(path: string | string[]):Route
* router.all([path: string | string[]], ...middlewares: Middleware):Router
* router[method]([path: string | string[]], ...middlewares: Middleware):Router
* router.params(name: string, callback: (ctx, next, value: string, name: string) => void):Router
### Route
* route.all([path: String | String[]], ...middlewares: (ctx, next) => void):Router
* route[method]([path: String | String[]], ...middlewares: (ctx, next) => void):Router
* route.all([path: string | string[]], ...middlewares: Middleware):Router
* route[method]([path: string | string[]], ...middlewares: Middleware):Router

@@ -196,0 +196,0 @@ ## Acknowledgements

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc