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 🙏

© 2025 – Pkg Stats / Ryan Hefner

starsling-tracekit

v0.1.6

Published

Local-first error intelligence tool (prototype)

Downloads

560

Readme

TraceKit — Local-first error intelligence (prototype)

TraceKit provides a small, local-first developer experience for collecting and inspecting runtime and dev-time errors during app development. It pairs a lightweight SDK (installed into the app under development) with a local companion server and a standalone UI at http://127.0.0.1:4321.

Status: prototype — use for development only.

Overview and key promises

  • The SDK must be installed inside the target app to capture runtime JS errors (browser or Node). There is no "magic" remote injection of runtime instrumentation.
  • The local server ingests events, groups them, and serves a UI for inspection.
  • An optional network monitor component can observe HTTP-level failures (500s, network errors, CORS issues). It cannot see JS runtime stack traces or React errors.

Quickstart — two workflows

  1. For app developers (how to use TraceKit with your app):
  • Install the SDK into your app (example package layout shown below). -- Start the local TraceKit server + UI (run on your dev machine):
# start the local server & UI (from the TraceKit CLI or local repo)
npx tracekit dev

Open http://127.0.0.1:4321 in your browser to view captured events.

  1. For contributors (working on the TraceKit repo itself):
npm install
npm run dev

This runs the codebase locally (ts-node) and serves the same UI at http://127.0.0.1:4321.

Commands (recommended CLI surface)

  • npx tracekit dev — start local server + UI
  • npx tracekit status — check server health
  • npx tracekit network — start the network monitor (HTTP-level diagnostics only)

Important security/behavior notes

  • The network monitor is a network-level diagnostic tool only. It cannot capture JS runtime exceptions, stack traces, or application-internal errors. Rename --proxy to --network-monitor if present in the CLI and document this limitation clearly.
  • Never promise zero-code setup for runtime error capture. State clearly that runtime capture requires installing the SDK into the running app.

SDK usage (recommended public entry points)

Prefer published, stable entry points instead of reaching into build output paths. Example public APIs we recommend exposing from the package exports:

Browser (recommended install via package manager):

import { installBrowser } from 'tracekit/browser'

installBrowser({ projectId: 'proj_local', environment: 'local' })

Browser (experimental/demo via script tag):

<!-- experimental/demo only -->
<script src="/path/to/browser.js"></script>
<script>
   // experimental: explicitly call install to instrument the page
   TraceKit && TraceKit.install && TraceKit.install({ projectId: 'proj_local' })
</script>

Node / Next.js (dev-time only):

// prefer a stable entry point exported by the package
import { installNode } from 'tracekit/node'

installNode({ projectId: 'proj_local', environment: 'local' })

Do not require('@tracekit/core/dist/...') or import deep paths — this bypasses package exports, breaks bundlers, and is fragile across builds.

Events API (ingest contract)

All ingestion POSTs to /events MUST include a projectId and an environment field so the server can correctly group and isolate events.

Example JSON shape (required fields):

{
   "projectId": "proj_local",
   "environment": "local",
   "event": {
      "id": "evt-123",
      "type": "runtime",
      "message": "Example error",
      "timestamp": 1600000000000,
      "payload": { /* optional error details, stack, metadata */ }
   }
}

Example curl (zsh) — replace timestamp with Date.now() if you like:

curl -X POST http://127.0.0.1:4321/events \
   -H 'Content-Type: application/json' \
   -d '{"projectId":"proj_local","environment":"local","event":{"id":"test-1","type":"runtime","message":"manual test","timestamp":1690000000000}}'

Or from the browser console:

fetch('http://127.0.0.1:4321/events', {
   method: 'POST',
   headers: { 'Content-Type': 'application/json' },
   body: JSON.stringify({ projectId: 'proj_local', environment: 'local', event: { id: 't-'+Date.now(), type: 'runtime', message: 'hello', timestamp: Date.now() } })
}).then(r => r.json()).then(console.log)

Build & publish

  • Build artifacts are emitted to dist/ (when running npm run build).
  • Ensure package exports expose stable entrypoints such as ./browser and ./node so integrators can import without deep paths.

Notes

  • Prototype uses an in-memory store. Document prominently: "Data is lost on restart" and provide the recommended migration to SQLite or similar for persistence.
  • The SDK defaults to posting to http://127.0.0.1:4321 in development; make the target configurable.
  • Do not include the SDK in production builds — it is dev-only by design.

Contributing

  • File issues or PRs against the repository specified in package.json.

Recommended next steps for the project

  • Rename --proxy to --network-monitor and document its limitations.
  • Add projectId as a required field in the ingestion schema and validate on the server.
  • Add public exports for browser and node entry points and update README examples.
  • Make the in-memory store a clearly documented optional prototype and provide a migration guide to a persistent store.