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

@ergenekon/probe

v0.4.1

Published

ERGENEKON recording probe — zero-config Express middleware for time-travel debugging

Readme

@ergenekon/probe

Zero-config Express middleware for recording production requests — time-travel debugging for distributed systems

npm License

Drop-in Express middleware that records every request with full deterministic replay capability. Captures HTTP, database queries, Date.now(), Math.random(), timers, crypto — everything needed to reproduce any bug on your laptop.

Install

npm install @ergenekon/probe

Quick Start

import express from 'express';
import { ErgenekonProbe } from '@ergenekon/probe';

const app = express();
const probe = new ErgenekonProbe({
  serviceName: 'my-service',
  collectorUrl: 'http://localhost:4380',
});

app.use(probe.middleware()); // That's it.

Smart Sampling

Default config records errors always, new routes always, and 1% of everything else:

const probe = new ErgenekonProbe({
  serviceName: 'my-service',
  collectorUrl: 'http://localhost:4380',
  sampling: {
    baseRate: 0.01,              // 1% random sampling
    latencyThresholdMs: 500,     // Always record slow requests (>500ms)
    sampleNewPaths: true,        // Always record first time seeing a route
    alwaysSampleErrors: true,    // Always record 5xx errors
    adaptiveEnabled: true,       // Auto-escalate to 100% on error spike
    adaptiveErrorThreshold: 0.05 // Trigger at 5% error rate
  }
});

Tail-Based Sampling

ERGENEKON uses tail-based sampling — buffers events and decides at request END. This means errors are never missed, even if the HEAD decision said "don't record."

Deep Redaction

Sensitive fields are automatically redacted before recording:

const probe = new ErgenekonProbe({
  serviceName: 'my-service',
  collectorUrl: 'http://localhost:4380',
  redactHeaders: ['authorization', 'cookie', 'x-api-key'],
  redactFields: ['password', 'creditCard', 'ssn'],
});

Auto-detected and redacted without configuration:

  • JWTs (eyJ...)
  • Credit card numbers
  • Bearer tokens
  • AWS access keys
  • PEM private keys

What Gets Intercepted

| Event | Description | |-------|-------------| | http_request_in | Incoming request (method, path, headers, body) | | http_response_out | Outgoing response (status, headers, body) | | http_request_out | Outgoing fetch() calls | | http_response_in | Responses from downstream services | | db_query / db_result | PostgreSQL, Redis, MongoDB queries | | timestamp | Every Date.now() call | | random | Every Math.random() call | | uuid | Every crypto.randomUUID() call | | timer_set / timer_fire | setTimeout / setInterval | | error | Uncaught exceptions | | console | console.log/warn/error output |

Auto-Detection

Database drivers are auto-detected — no config required:

// Just have them installed — probe detects automatically:
import pg from 'pg';      // PostgreSQL
import Redis from 'ioredis'; // Redis
import mongoose from 'mongoose'; // MongoDB

Local Mode (Development)

const probe = new ErgenekonProbe({ serviceName: 'dev' })
  .enableLocalMode(); // No collector needed

// After requests:
const recordings = probe.getRecordings();

Runtime Control

probe.setSamplingRate(0.5);      // Change rate live
probe.setEnabled(false);          // Pause recording
probe.forceRecord(10);            // Force-record next 10 requests
const stats = probe.getSamplingStats(); // { errorRate, adaptiveActive, ... }
await probe.shutdown();           // Flush and stop

Distributed Tracing

Automatically propagates W3C traceparent headers between services. Cross-service requests are linked by traceId — visible in the ERGENEKON UI as a distributed trace.

Part of ERGENEKON Engine

| Package | Description | |---------|-------------| | @ergenekon/core | Shared types, HLC clock, ULID | | @ergenekon/probe | ← You are here | | @ergenekon/collector | Ingestion server — stores recordings | | @ergenekon/replay | Replay engine — deterministic re-execution | | @ergenekon/cli | CLI — inspect, export, watch recordings |

License

Business Source License 1.1 — free for non-production use. Commercial license available at paradox.dev.