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

loadflux

v1.0.2

Published

Lightweight server monitoring dashboard for Node.js - embed Grafana like metrics in your existing server

Readme

LoadFlux

Lightweight, embeddable server monitoring dashboard for Node.js. Drop a single middleware into your Express or Fastify app and get a full Grafana-like dashboard no separate process, no external services.

Dashboard

Features

  • Real-time dashboard with live SSE updates every 2 seconds
  • System metrics — CPU, memory, disk usage, network I/O
  • App metrics — heap usage, event loop delay, GC pause time
  • Endpoint analytics — request count, latency percentiles (p50/p90/p95/p99), error rates
  • Error tracking — error log with status codes, durations, and stack traces
  • Configurable retention and slow request thresholds
  • Password-protected with bcrypt hashing and HMAC-SHA256 session tokens
  • Dark/light theme with time range selectors (5m to 30d)
  • SQLite by default (zero-config), optional MongoDB support
  • JSON export for all metrics
  • Works with Express, Fastify, and NestJS (via their underlying framework)

Quick Start

npm install loadflux

Express

import express from "express";
import { loadflux } from "loadflux";

const app = express();

app.use(loadflux({
  auth: { username: "admin", password: "secret" }
}));

app.get("/api/users", (req, res) => res.json({ users: [] }));

app.listen(3000);
// Dashboard at http://localhost:3000/loadflux

Fastify

import Fastify from "fastify";
import { loadfluxFastify } from "loadflux";

const app = Fastify();

app.register(loadfluxFastify({
  path: "/monitor",
  auth: { username: "admin", password: "secret" }
}));

app.get("/api/users", async () => ({ users: [] }));

await app.listen({ port: 3000 });
// Dashboard at http://localhost:3000/monitor

Documentation

For detailed guides, all dashboard pages, configuration reference, and more — visit the full docs:

loadflux.dev

Configuration

loadflux({
  // Dashboard URL path (default: "/loadflux")
  path: "/loadflux",

  // Authentication credentials
  auth: {
    username: "admin",
    password: "secret",
  },

  // Database backend
  database: {
    adapter: "sqlite",             // "sqlite" (default) or "mongodb"
    connectionString: "./loadflux.db", // SQLite path or MongoDB URI
  },

  // Collection intervals
  collection: {
    systemInterval: 5000,    // System metrics polling (ms)
    aggregationWindow: 5000, // Request aggregation flush (ms)
  },

  // Data retention
  retention: {
    days: 90,                 // Keep metrics for N days
    cronExpression: "0 2 * * *", // Cleanup schedule
  },

  // Flag requests slower than this (ms)
  slowRequestThreshold: 500,

  // Routes to exclude from monitoring
  excludeRoutes: ["/health", "/ready"],
});

You can also configure auth via environment variables:

LOADFLUX_USERNAME=admin
LOADFLUX_PASSWORD=secret

Requirements

  • Node.js >= 22.0.0

Tech Stack

| Component | Technology | |-----------|------------| | Server metrics engine | TypeScript, better-sqlite3, node-cron | | Dashboard UI | React 19, Tailwind CSS, Chart.js | | Real-time updates | Server-Sent Events (SSE) | | Auth | bcryptjs + HMAC-SHA256 tokens | | Build | tsup (server), Vite (UI) |

Development

# Install dependencies
npm install

# Build everything (server + UI)
npm run build

# Dev mode (server with watch)
npm run dev

# Dev mode (UI with Vite dev server)
npm run dev:ui

# Run tests
npm test

# Run the example server (requires build first)
node examples/test-server.mjs

License

MIT