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

errorcore

v0.5.1

Published

Source Available, publicly auditable error monitoring SDK for Node.js with I/O context and request metadata

Readme

errorcore

errorcore banner

errorcore is an error tracking tool for Node. When your code breaks in production, it captures the state leading up to the crash, not just where it broke.

Stack traces tell you where. errorcore tells you why.

Source Available / Publicly Auditable SDK. The public source is governed by the exact PolyForm Strict License 1.0.0 and is not represented as open source. Rights beyond that license require separate authorization from Errorcore under an applicable agreement. Errorcore Cloud and its backend are proprietary services outside the SDK license. See commercial licensing and the licensing history.

5-Minute Quickstart

npm install errorcore
npx errorcore init --quickstart
node errorcore-test.js
npx errorcore show --latest

The generated demo starts a tiny local Node app, performs one outbound fetch, captures a failing checkout request, and stores the event in .errorcore/events.ndjson. show --latest renders the captured stack, locals, request context, trace context, and IO timeline in your terminal.

To browse the same event in the local UI:

npx errorcore dashboard

For a real app, add errorcore at the top of your entry point:

const errorcore = require('errorcore');

errorcore.init(require('./errorcore.config.js'));

For framework apps, add the middleware so request timelines stay attached:

const { expressMiddleware, fastifyPlugin, honoMiddleware } = require('errorcore');

app.use(expressMiddleware());
fastify.register(fastifyPlugin);
honoApp.use('*', honoMiddleware());

Option A: Local Dashboard

Use a local NDJSON event store:

// errorcore.config.js
module.exports = {
  transport: { type: 'file', path: '.errorcore/events.ndjson' },
  allowUnencrypted: true
};

Trigger an error, then open the dashboard:

npx errorcore show --latest
npx errorcore dashboard

The dashboard runs at 127.0.0.1:4400 by default. npx ecd dashboard works too.

Option B: ErrorCore HTTP ingestion

Send captures to an ErrorCore ingestion endpoint with a server-side API key:

// errorcore.config.js
module.exports = {
  transport: { type: 'http', url: 'https://<ingest-host>/v1/ingest', apiKey: process.env.ERRORCORE_API_KEY },
  encryptionKey: process.env.ERRORCORE_DEK
};

transport.apiKey takes precedence over the ERRORCORE_API_KEY environment fallback and is sent as a Bearer credential. API keys are server-side secrets: never embed this config or ERRORCORE_API_KEY in browser or edge bundles.

Option C: Webhook

Send captured errors to your own endpoint:

// errorcore.config.js
module.exports = {
  transport: {
    type: 'webhook',
    url: 'https://example.com/errorcore-webhook',
    secret: process.env.ERRORCORE_WEBHOOK_SECRET
  },
  encryptionKey: process.env.ERRORCORE_DEK
};

Webhook batches are signed with HMAC-SHA256 when secret is set. See SETUP.md for the receiver verification snippet.

What errorcore captures

  • Captured local-variable previews at the moment an error is thrown. Explicit arguments[] is emitted only by ErrorPackage 1.4.0 inspector captures that can read the paused call frame; older packages do not contain exact arguments.
  • Ordered IO timeline events for inbound HTTP, outgoing HTTP/fetch, DNS/TCP, and DB queries
  • Request and response headers and bodies when enabled
  • DB query text and bind parameters when enabled
  • State reads and writes from tracked objects and maps
  • Process, release, environment, trace, and source-map context

Captured values are scrubbed and fieldized before they leave the process. Production configs should use encryption.

Capture modes

Use a fixed captureMode when you know the capture/overhead tradeoff you want:

| Mode | Standing infrastructure | Locals | | --- | --- | --- | | fast | transport only | off | | safe (default) | process crash handlers + transport; inbound event synthesized at capture | shallow, adaptive guard | | balanced | all recorders, worker assembly, payload spool | shallow | | forensic | everything + request/response bodies + DB bind params | deep |

Performance results are specific to an integrity-matched release candidate. Reproduce the per-mode measurements with BENCH_ERRORCORE_CAPTURE_MODE=<mode> docker compose -f docker-compose.yml -f docker-compose.capture-mode.yml up --build from bench/.

You can switch fixed modes at runtime without rebuilding the SDK:

await errorcore.setCaptureMode('forensic');
console.log(errorcore.getCaptureMode());

Each package records the mode snapshot used for assembly at completeness.modeAtCapture.

Adaptive capture starts in a base mode, escalates after an admitted capture, and de-escalates after quiet time:

errorcore.init({
  captureMode: 'safe',
  adaptiveCapture: {
    enabled: true,
    base: 'safe',
    escalated: 'forensic',
    deescalateAfterMs: 120000,
    minDwellMs: 10000,
    maxSwitchesPerHour: 60
  }
});

When adaptive capture is enabled, getHealth() includes adaptive.active, adaptive.phase, adaptive.lastEscalationAt, and adaptive.switchCount. Calling setCaptureMode() with the configured base or escalated mode updates the adaptive phase and preserves timed de-escalation. A different explicit mode reports the manual phase and suspends adaptive switching until base or escalated is selected again.

Safe mode captures shallow local variables at error time. While locals are armed, the V8 debugger pauses briefly on every thrown exception; if your workload throws at very high rates, the SDK's locals guard disarms locals for a recovery window (packages then report locals: disabled_adaptive_guard). It re-arms on adaptive escalation or after five quiet minutes below threshold. Tune or disable via localsGuard.

Middleware cost is separate from mode cost. The framework middleware (request context, trace propagation, request-scoped attribution) now keeps request data lazy until capture or trace propagation. The benchmark harness can isolate middleware-off, ALS-only, and full-middleware runs; publish comparisons only from a successful artifact for the exact package under test. Without middleware, safe still captures locals, error, stack, and process context; pass explicit request data to captureError(error, { request }) for request identity.

Licensing

The Errorcore SDK is Source Available / Publicly Auditable and is not represented as open source. PolyForm Strict License 1.0.0 governs the public SDK source. Separate authorization is required for any rights beyond that license; COMMERCIAL-LICENSE.md provides contact information but does not itself grant rights.

Errorcore Cloud and its backend are proprietary services outside the SDK license. Service access does not change the license governing the SDK. Team and service context lives in TEAMS.md.

Links