npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mmalk2405/express-pulse

v1.0.0

Published

A lightweight, zero-dependency infrastructure monitoring middleware for Express.js

Readme

express-pulse 🫀

NPM Version NPM Downloads Dependencies Bundle Size TypeScript License

A lightweight, highly concurrent infrastructure monitoring middleware for Express.js.

express-pulse provides a plug-and-play /health endpoint that pings your underlying databases and caches simultaneously, returning a load-balancer-friendly JSON report. It is built with zero dependency bloat—you bring your own database drivers, and we handle the monitoring.

Features

  • Zero Dependency Bloat: We don't install heavy database drivers. You pass in your existing instances.
  • Concurrent Execution: Pings all services simultaneously using Promise.all for zero-bottleneck monitoring.
  • Failsafe Design: If a database goes down, your server doesn't crash. The endpoint safely reports a down status.
  • Extensible Architecture: Easily write your own monitors for custom third-party APIs or SQL databases.

Installation

npm install express-pulse

Quick Start

Initialize the middleware and pass in your active database or cache clients.

import express from 'express';
import { MongoClient } from 'mongodb';
import { expressPulse, MongoMonitor, RedisMonitor } from 'express-pulse';

const app = express();

// 1. Initialize your databases (Native or Mongoose)
const mongoClient = new MongoClient('mongodb://localhost:27017');
mongoClient.connect();

// 2. Attach the middleware
app.use(expressPulse({
    endpoint: '/health', // Optional: defaults to '/health'
    monitors: [
        new MongoMonitor('Primary-DB', mongoClient),
        // new RedisMonitor('Cache', redisClient)
    ]
}));

app.listen(3000, () => console.log('Server is running...'));

Expected Output

When a load balancer, Kubernetes readiness probe, or monitoring tool hits GET /health, it receives:

{
  "status": "ok",
  "timestamp": "2026-05-22T12:39:25.108Z",
  "services": [
    {
      "name": "Primary-DB",
      "status": "up",
      "latency": 54
    }
  ]
}

Available Built-In Monitors

express-pulse includes zero-dependency adapters for the industry's most popular infrastructure. Just pass your existing, initialized client into the constructor.

NoSQL & Caches:

  • MongoMonitor (Supports Native MongoDB & Mongoose)
  • RedisMonitor (Supports Redis & ioredis)

Relational Databases (SQL):

  • PostgresMonitor (pg)
  • MysqlMonitor (mysql2)
  • MssqlMonitor (mssql)

Message Brokers & Event Streams:

  • RabbitMqMonitor (amqplib - safely uses channels)
  • KafkaMonitor (kafkajs - cluster metadata ping)

Search Engines & Cloud:

  • ElasticsearchMonitor (@elastic/elasticsearch)
  • S3Monitor (AWS S3 / Cloud Storage via HEAD requests)

External Services:

  • HttpMonitor (Generic REST API monitor via native fetch)

Writing Custom Monitors

Because express-pulse is built using the Strategy Pattern, you can easily monitor anything by implementing the PulseMonitor interface.

import { PulseMonitor, ServiceHealth } from 'express-pulse';

class StripeApiMonitor implements PulseMonitor {
    async check(): Promise<ServiceHealth> {
        const start = performance.now();
        try {
            await fetch('https://api.stripe.com/health');
            return { name: 'Stripe-API', status: 'up', latency: Math.round(performance.now() - start) };
        } catch (error) {
            return { name: 'Stripe-API', status: 'down', latency: 0 };
        }
    }
}

// Add it to your array!
app.use(expressPulse({
    monitors: [new StripeApiMonitor()]
}));

License

MIT