
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.
pm2-check-express
Advanced tools
Create express endpoints for health check and stats with pm2
$ npm install --save pm2-check-express
const express = require('express');
const app = express();
const pm2CheckRoutes = require('pm2-check-express');
app.use('/', function(req, res, next) {
//
});
pm2CheckRoutes(app, {
healthUrl: '/health',
statsUrl: '/stats',
timestampFormat: 'MM/DD/YY h:mm:ss a'
});
This will expose:
/health
route which returns 200
if all processes are online or 500
if any process is not online
/stats
route which returns a hash of stats:
{
healthy: true, // same as the /health route, but `true/false`
system: {
freeMemory: '2048.00MB',
totalMemory: '4096.00MB',
usedMemory: '2048.00MB',
usedMemoryPercent: 50.00,
cpuPercent: .36
},
processes: [
pid: 12345,
name: 'server',
instances: 1,
status: 'online',
lastStart: '07/04/2016 7:22 am',
lastStartAgo: '5 days ago',
firstStart: '07/01/2016 6:44 pm',
firstStartAgo: '8 days ago',
httpLatency: 155,
loopDelay: {},
restarts: 1,
memory: 22,
cpu: 12
}
FAQs
Add endpoints to Express to check health of system
We found that pm2-check-express demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.