Gathering detailed insights and metrics for @irae/express-middleware-timer
Gathering detailed insights and metrics for @irae/express-middleware-timer
Gathering detailed insights and metrics for @irae/express-middleware-timer
Gathering detailed insights and metrics for @irae/express-middleware-timer
A simple timer implementation for debugging express middleware.
npm install @irae/express-middleware-timer
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
7 Stars
23 Commits
2 Forks
7 Watchers
2 Branches
11 Contributors
Updated on Mar 28, 2023
Latest Version
1.0.0
Package Id
@irae/express-middleware-timer@1.0.0
Unpacked Size
16.38 kB
Size
4.74 kB
File Count
9
NPM Version
5.6.0
Node Version
6.12.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A simple timer implementation for debugging express middleware.
By default,
express-middleware-timer
does nothing. It's only activated when your application is started withTIMER=true
.
Note:
See examples for more detailed working examples.
1// require module 2var emt = require('express-middleware-timer'); 3 4// init timer 5app.use(emt.init()); 6 7/*** 8 * // custom report example 9 * 10 * app.use(emt.init(function report(req, res) { 11 * var report = emt.calculate(req,res); 12 * console.log('TIMER: %s %s %s', 13 * new Date(), 14 * report.request.url, 15 * JSON.stringify(report.timers)); 16 * }); 17 * 18 ***/ 19 20// instrument middleware 21app.use(emt.instrument(myMiddleware), 'myMiddleware'); 22 23// instrument array of middlewares 24var middlewares = emt.instrument([ 25 middlewareOne, 26 middlewareTwo, 27 middlewareThree 28]); 29 30middleware.forEach(function(middleware) { 31 app.use(middleware); 32}); 33 34// routes 35app.get('/', myRoute); 36 37// start 38app.listen(3000);
To enable your timer, start your application with TIMER=true
.
1TIMER=true node ./app.js 2 3# to start the example 4TIMER=true node ./example/app1.js
Note:
See
examples/simple.js
for the code that generated this output.
1{ request: 2 { url: '/', 3 headers: 4 { host: 'localhost:3000', 5 connection: 'keep-alive', 6 accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 7 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/30.0.1599.114 Chrome/30.0.1599.114 Safari/537.36', 8 'accept-encoding': 'gzip,deflate,sdch', 9 'accept-language': 'en-US,en;q=0.8', 10 'if-none-match': '"222957957"' } }, 11 timers: 12 { startup: { from_start: 0, took: 0 }, 13 slowMiddleware: { took: 201, from_start: 201 }, 14 fastMiddleware: { took: 0, from_start: 201 } } }
1npm install 2npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
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