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

pulse-monitor

v1.0.5

Published

Zero-impact backend monitoring tool for Express and NestJS

Readme

⚡ Pulse Monitor

A zero-latency-impact backend performance and security monitoring tool for both Express.js and NestJS applications. It bundles a premium, interactive real-time dashboard into a single self-contained HTML asset and auto-adapts to Serverless (Vercel, Netlify, AWS Lambda) and Stateful (Node.js daemon) runtimes.


✨ Features

  • 🚀 Zero-Impact Observability: Offloads telemetry aggregation to background Worker Threads in stateful environments.
  • 🛡️ Intrusion Detection System (IDS): Auto-inspects path traversal, SQL Injection (SQLi), Cross-Site Scripting (XSS), and malicious User-Agent signatures.
  • ☁️ Serverless Native: Automatically detects serverless execution environments and shifts from background thread queuing to zero-loss synchronous logs or database flushes.
  • 🎛️ Single-File Dashboard: React UI compiled into a single, inline HTML file (dist/ui/index.html) using vite-plugin-singlefile to completely bypass 404 static asset paths and CORS problems.
  • 🔐 Stealth Mode & Security: Configurable IP whitelists and access secrets. Hide the dashboard completely (return 404/next) for unwhitelisted clients.
  • 📊 Premium Visual Analytics: Responsive, beautiful dark-themed dashboard with real-time SVG charting, sorting, filtering, and deep request inspection.

📦 Installation

Install the package via your preferred package manager:

# npm
npm install pulse-monitor

# pnpm
pnpm add pulse-monitor

# yarn
yarn add pulse-monitor

# bun
bun add pulse-monitor

🚀 Quick Start

1. Express.js Integration

import express from 'express';
import { Monitor, expressPulseMiddleware } from 'pulse-monitor';

const app = express();

// Initialize the Monitor instance
const monitor = new Monitor({
  maxBufferSize: 1000,
  enableThreatDetection: true,
  dashboardEndpoint: '/pulse', // Accessible path
  authSecret: 'your-secure-dashboard-password', // Optional password
});

// Register the Pulse middleware
app.use(expressPulseMiddleware(monitor));

app.get('/api/users', (req, res) => {
  res.json([{ id: 1, name: 'Alice' }]);
});

app.listen(3000, () => {
  console.log('Server is running on port 3000');
  console.log('Dashboard is available at http://localhost:3000/pulse');
});

2. NestJS Integration

Step 1: Create a global Module or Provider for the Monitor instance

// pulse.module.ts
import { Module, Global } from '@nestjs/common';
import { Monitor } from 'pulse-monitor';

@Global()
@Module({
  providers: [
    {
      provide: Monitor,
      useValue: new Monitor({
        maxBufferSize: 1000,
        enableThreatDetection: true,
        dashboardEndpoint: '/pulse',
        authSecret: 'secret-key',
      }),
    },
  ],
  exports: [Monitor],
})
export class PulseModule {}

Step 2: Bind the Interceptor & Middleware

// main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Monitor, NestJSPulseInterceptor, expressPulseMiddleware } from 'pulse-monitor';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  
  // Resolve the Monitor instance
  const monitor = app.get(Monitor);
  
  // Use Express middleware to handle dashboard routes
  app.use(expressPulseMiddleware(monitor));
  
  // Use the NestJS interceptor to capture route performance & metrics
  app.useGlobalInterceptors(new NestJSPulseInterceptor(monitor));

  await app.listen(3000);
}
bootstrap();

⚙️ Configuration Options

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | maxBufferSize | number | 1000 | Limits the maximum request logs and threat alerts kept in the in-memory circular buffer. | | enableThreatDetection | boolean | true | Enables/disables the real-time intrusion signature scanner. | | whitelistIps | string[] | [] | List of client IPs authorized to view the dashboard. If populated, unwhitelisted IPs will be ignored (Stealth Mode). | | dashboardEndpoint | string | '/pulse' | Route path where the dashboard will be served. | | authSecret | string | '' | Passcode required to view the dashboard. Prompts a secure login page if set. | | databaseUrl | string | '' | Optional database persistence endpoint (useful in serverless environments). |


🛠️ Build and Development

To build the package locally for production or npm publishing:

# 1. Install dependencies
pnpm install

# 2. Build backend and frontend assets
pnpm run build

This will:

  1. Compile TypeScript source files using tsup into dist/index.js (ES Modules) and dist/index.cjs (CommonJS).
  2. Install dashboard dependencies and bundle the React code into a single self-contained HTML page at dist/ui/index.html.

📄 License

MIT © Pulse Monitor