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

apm-optima

v1.0.5

Published

> Lightweight, real-time Application Performance Monitoring (APM) and telemetry library for Node.js web applications.

Readme

apm-optima

Lightweight, real-time Application Performance Monitoring (APM) and telemetry library for Node.js web applications.

npm version license github

Features

  • Real-Time Telemetry: HTTP request latency, status codes, and throughput.
  • Node.js Diagnostics: Event Loop lag monitoring, process memory distribution, and active handles.
  • Embedded Dashboard UI: Instant built-in dashboard available directly at your metrics route.
  • Console Logger: Pretty-printed HTTP request duration and status output.

Installation

npm install apm-optima

Quick Start (Express)

const express = require('express');
const { setupOptima } = require('apm-optima/express');

const app = express();
app.use(express.json());

// Initialize Optima telemetry & embed UI
const optima = setupOptima(app, {
  dashboardPath: '/optima-metrics',
  publisher: {
    intervalMs: 1000,
    slowLatencyThresholdMs: 500,
  },
});

app.get('/api/v1/resource', (req, res) => {
  res.json({ status: 'ok' });
});

const server = app.listen(3000, () => {
  console.log('Server running on port 3000');
});

// Attach WebSocket server & background timers
const stopMetrics = optima.attachServer(server);

Quick Start (NestJS)

import { Module } from '@nestjs/common';
import { MetricsModule } from 'apm-optima/nest';

@Module({
  imports: [
    MetricsModule.forRoot({
      dashboardPath: '/optima-metrics',
      publisher: {
        intervalMs: 1000,
        slowLatencyThresholdMs: 500,
      },
      excludePaths: ['/health'],
    }),
  ],
})
export class AppModule {}

Configuration Options

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | dashboardPath | string \| false | /optima-metrics | Route endpoint for serving the embedded UI (false to disable). | | simulation | false \| { intervalMs: number, requestsPerTick: number } | false | Generates synthetic traffic for local testing and load simulation. | | publisher.intervalMs | number | 1000 | Broadcast interval (in ms) for pushing telemetry updates over WebSockets. | | publisher.slowLatencyThresholdMs | number | 500 | Latency limit in milliseconds above which requests are flagged as slow. | | publisher.eventLoopLagThresholdMs | number | 50 | Event Loop delay threshold in milliseconds for triggering lag alerts. | | publisher.eventLoopResolutionMs | number | 10 | Sampling resolution interval for computing Event Loop delay. | | tickIntervalMs | number | 250 | Resolution interval for recalculating internal metrics and buckets. | | excludePaths | string[] | ['/_next/*','/_next/**','*.map','/favicon.ico','/metrics_pack'] | Array of route patterns or paths to skip from metric collection (e.g., /health). | | consoleLog | boolean | false | Enables logging internal system events and alerts to stdout. | | ringBufferSize | number | 60 | Capacity of the internal ring buffer used for storing time-series data. | | alertBufferSize | number | 100 | Maximum capacity of the buffer holding recent alerts and detected anomalies. |

License

MIT