From 83d2b34440c8900c672b3f37c2e5ce80a1372c41 Mon Sep 17 00:00:00 2001 From: Imed Jaberi Date: Thu, 15 Aug 2024 15:43:48 +0100 Subject: [PATCH] refactor: support Node.js v18+ and replace the debug module with native Node.js one (#181) --- .github/workflows/ci.yml | 1 + lib/router.js | 4 +++- package.json | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14fc857..8b59806 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: os: - ubuntu-latest node_version: + - 18 - 20 - 22 name: Node ${{ matrix.node_version }} on ${{ matrix.os }} diff --git a/lib/router.js b/lib/router.js index 748520b..a806b85 100644 --- a/lib/router.js +++ b/lib/router.js @@ -5,10 +5,12 @@ * @link https://github.com/alexmingoia/koa-router */ const http = require('node:http'); +const util = require('node:util'); + +const debug = util.debuglog('koa-router'); const compose = require('koa-compose'); const HttpError = require('http-errors'); -const debug = require('debug')('koa-router'); const { pathToRegexp } = require('path-to-regexp'); const Layer = require('./layer'); diff --git a/package.json b/package.json index 17e494c..ca0ce2b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ } ], "dependencies": { - "debug": "^4.3.6", "http-errors": "^2.0.0", "koa-compose": "^4.1.0", "path-to-regexp": "^6.2.2" @@ -45,7 +44,7 @@ "xo": "0.53.1" }, "engines": { - "node": ">= 20" + "node": ">= 18" }, "files": [ "lib"