Skip to content

Commit 83d2b34

Browse files
authored
refactor: support Node.js v18+ and replace the debug module with native Node.js one (#181)
1 parent f7ffb93 commit 83d2b34

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
os:
1111
- ubuntu-latest
1212
node_version:
13+
- 18
1314
- 20
1415
- 22
1516
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}

lib/router.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
* @link https://github.com/alexmingoia/koa-router
66
*/
77
const http = require('node:http');
8+
const util = require('node:util');
9+
10+
const debug = util.debuglog('koa-router');
811

912
const compose = require('koa-compose');
1013
const HttpError = require('http-errors');
11-
const debug = require('debug')('koa-router');
1214
const { pathToRegexp } = require('path-to-regexp');
1315

1416
const Layer = require('./layer');

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
}
2222
],
2323
"dependencies": {
24-
"debug": "^4.3.6",
2524
"http-errors": "^2.0.0",
2625
"koa-compose": "^4.1.0",
2726
"path-to-regexp": "^6.2.2"
@@ -45,7 +44,7 @@
4544
"xo": "0.53.1"
4645
},
4746
"engines": {
48-
"node": ">= 20"
47+
"node": ">= 18"
4948
},
5049
"files": [
5150
"lib"

0 commit comments

Comments
 (0)