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

@tracewayapp/core

v1.0.7

Published

Shared types and utilities for Traceway SDKs

Downloads

780

Readme

Traceway JS Core

Shared types and utilities consumed by every Traceway JavaScript SDK. Zero runtime dependencies, framework-agnostic, safe to import anywhere — browser, Node, React Native, Hermes, Cloudflare Workers.

Traceway is a completely open-source error tracking platform. You can self-host it or use Traceway Cloud.

You probably don't need to install this directly. It's a transitive dependency of @tracewayapp/frontend, @tracewayapp/react-native, and the framework wrappers. Install one of those instead. Reach for @tracewayapp/core directly only if you're building your own SDK or rendering Traceway's wire types in a dashboard.

Features

  • Type definitions for the full Traceway wire format — exceptions, metrics, traces, spans, session recordings
  • Discriminated union for the timeline event types (logs, network, navigation, custom breadcrumbs)
  • A bounded rolling EventBuffer<T> keyed by time window + max size, used by every higher-level SDK to capture the last ~10 seconds of activity
  • Connection-string parser, UUID v4 generator, ISO-8601 timestamp helper
  • Constants for built-in metric names (mem.used, cpu.used_pcnt, etc.)
  • Pure ESM + CJS dual output, full TypeScript declarations

Installation

npm install @tracewayapp/core

Quick Start

import {
  parseConnectionString,
  generateUUID,
  nowISO,
  EventBuffer,
  type LogEvent,
  type ReportRequest,
} from "@tracewayapp/core";

const { token, apiUrl } = parseConnectionString(
  "your-token@https://traceway.example.com/api/report",
);

// Rolling buffer that drops entries older than 10s OR beyond 200 entries:
const logs = new EventBuffer<LogEvent>({ windowMs: 10_000, maxSize: 200 });
logs.add({
  type: "log",
  timestamp: nowISO(),
  level: "info",
  message: "user reached checkout",
});

const recent: LogEvent[] = logs.snapshot();

Wire Types

Reporting

| Type | Description | |------|-------------| | ExceptionStackTrace | Single exception/message record | | MetricRecord | Metric data point (name, value, recordedAt, optional tags) | | Span | Sub-operation span within a trace | | Trace | Endpoint or task trace | | CollectionFrame | Batch of stack traces, metrics, traces, and session recordings | | ReportRequest | Top-level request payload sent to /api/report |

Timeline (logs, actions, recordings)

The browser, RN, and framework SDKs ship a rolling timeline of logs and action breadcrumbs alongside each captured exception. The wire types are defined here so dashboards and custom SDKs can share them.

| Type | Description | |------|-------------| | TracewayEventBase | Discriminator (type) + timestamp shared by all timeline events | | LogEvent | Console log: level (debug / info / warn / error) + message | | NetworkEvent | fetch / XHR request: method, url, durationMs, optional statusCode, byte counts, error | | NavigationEvent | History API or manual navigation transition: action (push / replace / pop), from, to | | CustomEvent | User-defined breadcrumb from recordAction(category, name, data?) | | TracewayEvent | Discriminated union of the four event types above | | SessionRecordingPayload | Replay frames + buffered logs + actions + startedAt / endedAt anchors, attached to an exception via exceptionId |

Utilities

| Function | Description | |----------|-------------| | parseConnectionString(str) | Split {token}@{apiUrl} into { token, apiUrl }; throws on malformed input | | generateUUID() | Generate a UUID v4 string | | nowISO() | Current time as ISO 8601 string | | msToNanoseconds(ms) | Convert milliseconds to nanoseconds (integer) | | EventBuffer<T> | Bounded rolling buffer (windowMs, maxSize) used by the higher-level SDKs to keep the most recent logs and actions |

Constants

| Constant | Value | |----------|-------| | METRIC_MEM_USED | "mem.used" | | METRIC_MEM_TOTAL | "mem.total" | | METRIC_CPU_USED_PCNT | "cpu.used_pcnt" |

Platform Support

| Environment | Status | |---|---| | Browser (any modern engine) | Yes | | Node.js ≥ 18 | Yes | | React Native (Hermes / JSC) | Yes | | Cloudflare Workers / Deno / Bun | Yes |

Links

License

MIT