
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
event-loop-lag
Advanced tools
#event-loop-lag
Measures Node.js event loop lag.
var interval = 1000; // how often to refresh our measurement
var lag = require('event-loop-lag')(interval);
console.log('event loop lag is %d', lag());
event-loop-lag
accepts a number of milliseconds representing how
often to refresh the event loop lag measurement and returns a function
you can call to receive the latest lag measurement in milliseconds.
var lag = require('event-loop-lag')(1000);
var koa = require('koa');
var app = koa();
app.use(function*(next){
if ('/lag' == this.url)
this.body = lag() + ' milliseconds';
else
yield next;
})
npm install event-loop-lag --save
make test
runs testsmake test-cov
runs tests + test coveragemake open-cov
opens test coverage results in your browserevent-loop-lag
supports the debug
module for help during development.
Enable verbose logging by setting your DEBUG
env variable like so:
DEBUG=event-loop-lag* npm test
FAQs
Measure event loop lag
The npm package event-loop-lag receives a total of 17,973 weekly downloads. As such, event-loop-lag popularity was classified as popular.
We found that event-loop-lag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.