Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
express-status-monitor
Advanced tools
Simple, self-hosted module based on Socket.io and Chart.js to report realtime server metrics for Express-based node servers.
npm install express-status-monitor --save
app.use(require('express-status-monitor')());
/status
cd examples/
npm i
npm start
http://0.0.0.0:3000
Monitor can be configured by passing options object into expressMonitor
constructor.
Default config:
title: 'Express Status', // Default title
path: '/status',
websocket: existingSocketIoInstance,
spans: [{
interval: 1, // Every second
retention: 60 // Keep 60 datapoints in memory
}, {
interval: 5, // Every 5 seconds
retention: 60
}, {
interval: 15, // Every 15 seconds
retention: 60
}]
Example using https://www.npmjs.com/package/connect-ensure-login
const ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn()
app.get('/status', ensureLoggedIn, require('express-status-monitor')())
Credits to @mattiaerre
Example using http-auth
const auth = require('http-auth');
const basic = auth.basic({realm: 'Monitor Area'}, function(user, pass, callback) {
callback(user === 'username' && pass === 'password');
});
app.get('/status', auth.connect(basic), require('express-status-monitor')());
If you're using socket.io in your project, this module could break your project because this module by default will spawn its own socket.io instance. To mitigate that, fill websocket parameter with your main socket.io instance as well as port parameter.
In order to run test and coverage use the following npm commands:
npm test
npm run coverage
MIT License © Rafal Wilinski
FAQs
Realtime Monitoring for Express-based Node applications
The npm package express-status-monitor receives a total of 18,622 weekly downloads. As such, express-status-monitor popularity was classified as popular.
We found that express-status-monitor 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.