
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Comprehensive monitoring solution for Node.js applications with error tracking, health checks, multi-database support (MongoDB, PostgreSQL, MySQL, MSSQL, SQLite, Redis, Cassandra, Elasticsearch, DynamoDB, Neo4j, CouchDB), and multi-channel notifications
Production-ready monitoring solution for Node.js applications with comprehensive database support, error tracking, health checks, and multi-channel notifications.
npm install pms_md
Install only the database drivers you need:
# SQL Databases
npm install pg # PostgreSQL
npm install mysql2 # MySQL
npm install mariadb # MariaDB
npm install mssql # MSSQL (SQL Server)
npm install sqlite3 # SQLite
# NoSQL Databases
npm install mongoose # MongoDB
npm install nano # CouchDB
npm install cassandra-driver # Cassandra
# Cache & Search
npm install ioredis # Redis
npm install @elastic/elasticsearch # Elasticsearch
# Cloud Databases
npm install @aws-sdk/client-dynamodb # DynamoDB
# Graph Databases
npm install neo4j-driver # Neo4j
# ORM
npm install sequelize # Sequelize (MySQL, PostgreSQL, SQLite, MSSQL)
const express = require('express');
const NodeMonitor = require('pms_md');
const app = express();
// Initialize monitor
const monitor = new NodeMonitor({
app: {
name: 'my-app',
environment: 'production'
},
notifications: {
email: {
enabled: true,
smtp: {
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_APP_PASSWORD
}
},
from: process.env.EMAIL_USER,
recipients: ['admin@example.com']
}
}
});
// Add middleware
app.use(monitor.requestLogger());
app.use(monitor.errorMiddleware());
// Health endpoints
app.get('/health', monitor.healthCheckEndpoint());
app.get('/health/info', monitor.healthInfoEndpoint());
// Start monitoring
monitor.start();
// Start server
const server = app.listen(3000, () => {
console.log('Server running on port 3000');
});
// Graceful shutdown with email notifications
monitor.setupGracefulShutdown(server);
module.exports = app;
Add a complete monitoring dashboard to your app with just one line of code:
const express = require('express');
const NodeMonitor = require('pms_md');
const app = express();
const monitor = new NodeMonitor({
app: { name: 'My App' }
});
// ===== ONE LINE TO ENABLE ENTIRE UI! =====
monitor.serveUI(app);
monitor.start();
app.listen(3000);
After calling monitor.serveUI(app), you get:
/ - Navigation hub with quick links/monitor/dashboard - Complete monitoring overview/health - Live health status with auto-refresh/monitor/metrics - Interactive charts (CPU, Memory)/monitor/status - Real-time status overview/monitor/error-logs - Error tracking✅ Zero Configuration - Works out of the box
✅ No File Copying - Everything served from node_modules
✅ Beautiful Design - Modern, responsive UI
✅ Real-time Updates - Auto-refresh dashboards
✅ Interactive Charts - Powered by Chart.js
✅ Dark/Light Theme - User preference support
✅ Content Negotiation - Supports both HTML and JSON
// Custom base path
monitor.serveUI(app, {
basePath: '/monitoring',
appName: 'Production API',
enableErrorLogs: true
});
// UI now available at:
// http://localhost:3000/monitoring/
// http://localhost:3000/monitoring/dashboard
Visit http://localhost:3000/ after starting your server to see the beautiful UI!
📚 Complete UI Integration Guide →
const sql = require('mssql');
const pool = await sql.connect({
server: 'localhost',
database: 'mydb',
user: 'sa',
password: 'password',
options: {
encrypt: true,
trustServerCertificate: true
}
});
monitor.registerDatabase('mssql', 'mssql', pool);
const { Pool } = require('pg');
const pool = new Pool({
host: 'localhost',
database: 'mydb',
user: 'postgres',
password: 'password'
});
monitor.registerDatabase('postgres', 'postgresql', pool);
const mysql = require('mysql2/promise');
const pool = mysql.createPool({
host: 'localhost',
user: 'root',
password: 'password',
database: 'mydb'
});
monitor.registerDatabase('mysql', 'mysql2', pool);
const mongoose = require('mongoose');
await mongoose.connect('mongodb://localhost:27017/mydb');
monitor.registerDatabase('mongodb', 'mongoose', mongoose.connection);
const Redis = require('ioredis');
const redis = new Redis({
host: 'localhost',
port: 6379
});
monitor.registerDatabase('redis', 'redis', redis);
const sqlite3 = require('sqlite3');
const db = new sqlite3.Database('./mydb.sqlite');
monitor.registerDatabase('sqlite', 'sqlite', db);
const cassandra = require('cassandra-driver');
const client = new cassandra.Client({
contactPoints: ['localhost'],
localDataCenter: 'datacenter1'
});
await client.connect();
monitor.registerDatabase('cassandra', 'cassandra', client);
| Database | Type | Package | Status |
|---|---|---|---|
| MongoDB | NoSQL | mongoose | ✅ |
| PostgreSQL | SQL | pg | ✅ |
| MySQL | SQL | mysql2 | ✅ |
| MariaDB | SQL | mariadb | ✅ |
| MSSQL | SQL | mssql | ✅ |
| SQLite | SQL | sqlite3 | ✅ |
| Redis | Cache | ioredis | ✅ |
| CouchDB | NoSQL | nano | ✅ |
| Cassandra | NoSQL | cassandra-driver | ✅ |
| Elasticsearch | Search | @elastic/elasticsearch | ✅ |
| DynamoDB | Cloud | @aws-sdk/client-dynamodb | ✅ |
| Neo4j | Graph | neo4j-driver | ✅ |
| Sequelize | ORM | sequelize | ✅ |
EMAIL_USER=your-email@gmail.com
EMAIL_APP_PASSWORD=your-16-char-app-password
const monitor = new NodeMonitor({
notifications: {
email: {
enabled: true,
smtp: {
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_APP_PASSWORD
}
},
from: process.env.EMAIL_USER,
recipients: ['admin@example.com', 'team@example.com']
}
}
});
// Automatic error tracking and email notifications
app.use(monitor.errorMiddleware());
// Log all HTTP requests with sanitization
app.use(monitor.requestLogger());
// Handle 404 errors
app.use(monitor.notFoundHandler());
app.get('/health', monitor.healthCheckEndpoint());
Response:
{
"status": "healthy",
"timestamp": "2025-11-17T12:00:00.000Z",
"uptime": 3600,
"databases": {
"mssql": "connected",
"redis": "connected"
}
}
app.get('/health/info', monitor.healthInfoEndpoint());
Response:
{
"status": "healthy",
"timestamp": "2025-11-17T12:00:00.000Z",
"uptime": 3600,
"system": {
"cpu": 45.2,
"memory": {
"used": 512,
"total": 8192,
"percentage": 6.25
}
},
"databases": {
"mssql": {
"status": "connected",
"type": "mssql",
"version": "Microsoft SQL Server 2019...",
"connections": 10
}
}
}
Automatically send email notifications when your server shuts down:
const server = app.listen(3000);
// Setup graceful shutdown with email notifications
monitor.setupGracefulShutdown(server);
Features:
const monitor = new NodeMonitor({
app: {
name: 'my-production-app',
environment: 'production',
version: '1.0.0'
},
monitoring: {
enabled: true,
interval: 60000, // Check every 60 seconds
systemMetrics: true,
apiErrors: true
},
database: {
enabled: true,
checkInterval: 30000, // Check every 30 seconds
queryTimeout: 5000,
consecutiveFailuresThreshold: 3
},
notifications: {
email: {
enabled: true,
smtp: {
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_APP_PASSWORD
}
},
from: process.env.EMAIL_USER,
recipients: ['admin@example.com']
},
slack: {
enabled: false,
webhookUrl: process.env.SLACK_WEBHOOK_URL
}
},
logging: {
level: 'info',
directory: './logs',
maxFiles: '14d',
maxSize: '20m',
sanitize: true
}
});
monitor.start()Start all monitoring services.
monitor.stop()Stop all monitoring services.
monitor.registerDatabase(name, type, connection)Register a database for monitoring.
Parameters:
name (string) - Unique identifier for the databasetype (string) - Database type (e.g., 'mssql', 'postgresql', 'mongodb')connection (object) - Database connection objectmonitor.getDatabaseStats(name)Get statistics for a specific database.
Returns: Promise
monitor.getAllDatabaseStats()Get statistics for all registered databases.
Returns: Promise
monitor.setupGracefulShutdown(server)Setup graceful shutdown with email notifications.
Parameters:
server (object) - HTTP server instancemonitor.errorMiddleware()Express middleware for error handling.
monitor.requestLogger()Express middleware for request logging.
monitor.notFoundHandler()Express middleware for 404 errors.
monitor.healthCheckEndpoint()Express endpoint handler for basic health check.
monitor.healthInfoEndpoint()Express endpoint handler for detailed health information.
monitor.dashboardEndpoint()Express endpoint handler for monitoring dashboard.
Run the comprehensive test suite:
node test-all-databases.js
Test Coverage:
./logs directorymonitoring.interval to reduce frequencylogging.maxFiles retention periodContributions are welcome! Please feel free to submit a Pull Request.
ISC License - see LICENSE file for details
Manish Proses
Built with:
Planned features for future releases:
Made with ❤️ for the Node.js community
FAQs
Comprehensive monitoring solution for Node.js applications with error tracking, health checks, multi-database support (MongoDB, PostgreSQL, MySQL, MSSQL, SQLite, Redis, Cassandra, Elasticsearch, DynamoDB, Neo4j, CouchDB), and multi-channel notifications
We found that pms_md demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.