Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use native Node.js modules, support Node.js v20+ and modernize the code #180

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ jobs:
os:
- ubuntu-latest
node_version:
- 14
- 16
- 18
- 20
- 22
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .xo-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
'unicorn/explicit-length-check': 'warn',
'unicorn/no-array-reduce': 'warn',
'unicorn/prefer-spread': 'warn',
'unicorn/prefer-node-protocol': 'off'
'unicorn/prefer-node-protocol': 'off',
'unicorn/expiring-todo-comments': 'off',
'max-nested-callbacks': 'off'
}
};
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ See [API Reference](./API.md) for more documentation.
| ---------------- |
| **Alex Mingoia** |
| **@koajs** |
| **Imed Jaberi** |


## License
Expand Down
11 changes: 8 additions & 3 deletions bench/server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const Koa = require('koa');
const Router = require('../');
const process = require('node:process');
const env = require('@ladjs/env')({
path: '../.env',
includeProcessEnv: true,
assignToProcessEnv: true
});
const Koa = require('koa');

const Router = require('../');

const app = new Koa();
const router = new Router();

const ok = (ctx) => (ctx.status = 200);
const ok = (ctx) => {
ctx.status = 200;
};

const n = Number.parseInt(env.FACTOR || '10', 10);
const useMiddleware = env.USE_MIDDLEWARE === 'true';

Expand Down
Loading
Loading