Gathering detailed insights and metrics for koa-better-timeout
Gathering detailed insights and metrics for koa-better-timeout
Gathering detailed insights and metrics for koa-better-timeout
Gathering detailed insights and metrics for koa-better-timeout
npm install koa-better-timeout
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
15 Commits
3 Forks
8 Watching
2 Branches
4 Contributors
Updated on 23 Jul 2020
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-39.6%
32
Compared to previous day
Last week
-11.9%
238
Compared to previous week
Last month
-15.9%
1,176
Compared to previous month
Last year
-6.7%
9,589
Compared to previous year
Response timeout middleware for Koa and Lad (uses Boom by default)
npm:
1npm install koa-better-timeout
yarn:
1yarn add koa-better-timeout
Default middleware usage:
1const Timeout = require('koa-better-timeout'); 2 3// ... 4 5const timeout = new Timeout(); 6app.use(timeout.middleware);
Advanced middleware usage (e.g. using Lad and its @ladjs/i18n middleware) with translated response message:
1const Timeout = require('koa-better-timeout'); 2 3// ... 4 5const timeout = new Timeout({ 6 message: ctx => ctx.translate('REQUEST_TIMED_OUT') 7}); 8app.use(timeout.middleware);
You can optionally pass an object of options to Timeout(opts)
.
The default option values use Boom and are:
1{
2 ms: 6000,
3 message: Boom.clientTimeout().message,
4 sendResponse: Boom.clientTimeout
5}
Note that message
can be a function that accepts one argument ctx
. This is useful if you wish to use i18n translation for the response message.
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More