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

@ayushtripathy/tracebox

v0.0.3

Published

Official lightweight JavaScript/TypeScript SDK for TraceBox — remote debugging and runtime capture platform

Downloads

419

Readme

TraceBox SDK

Lightweight, production-grade JavaScript & TypeScript SDK for TraceBox — remote debugging and runtime capture platform.

Temporarily drop TraceBox into any backend or full-stack application to capture arbitrary runtime data, nested structures, circular objects, and errors, and inspect them in real time on your TraceBox Console.


Installation

npm install tracebox
# or
yarn add tracebox
# or
pnpm add tracebox
# or
bun add tracebox

Quick Start

import { TraceBox } from "tracebox";

// 1. Initialize with your project slug and API key
const trace = new TraceBox({
  projectSlug: "my-store",
  apiKey: "tb_xxxxxxxxxxxxxxxxxxxxxxxx"
});

// 2. Capture any runtime data into a named Box
const response = await fetch("https://api.example.com/checkout");
const data = await response.json();

await trace.capture(data, "affirm-issue-001");

All captures with the same box parameter ("affirm-issue-001") are grouped together under that Box in the web console.


Configuration Options

interface TraceBoxOptions {
  /** Required project slug */
  projectSlug: string;

  /** Required API key with tb_ prefix */
  apiKey: string;

  /** Optional base API URL (default: "https://api.tracebox.io") */
  baseUrl?: string;

  /** Optional request timeout in milliseconds (default: 5000ms) */
  timeoutMs?: number;

  /** If true, capture failures throw errors. Default false (failsafe) */
  strict?: boolean;
}

Local Development / Self-Hosted Server

const trace = new TraceBox({
  projectSlug: "my-store",
  apiKey: "tb_xxxxxxxxxxxxxxxxxxxxxxxx",
  baseUrl: "http://localhost:8080"
});

Labels & Metadata

You can optionally tag captures with a label and structured metadata:

await trace.capture(error, "checkout-debug", {
  label: "payment-gateway-timeout",
  metadata: {
    environment: "production",
    userId: "usr_9921",
    requestId: "req_88192a"
  }
});

Intelligent Serialization

TraceBox safely handles complex and non-standard JavaScript data without throwing or crashing host applications:

  • Circular references: Cyclic graphs are marked safely as "[Circular]"
  • Error objects: Preserves name, message, stack, and cause
  • Axios responses: Serializes status, headers, data, and config cleanly without internal socket handles
  • Deep nesting: Supports arbitrary nesting depths with zero artificial level caps
  • Primitives & Dates: Serializes Date, BigInt, RegExp, null, undefined
const obj: any = { status: "pending" };
obj.self = obj;

// Safe: will not crash or cause infinite loops
await trace.capture(obj, "cyclic-test");

Reliability Guarantee

TraceBox is engineered to never impact your host application:

  1. Lightweight & zero bloat: Minimal footprint, zero native runtime dependencies.
  2. Never crashes host processes: If TraceBox is unreachable or times out, errors fail safely without unhandled promise rejections.
  3. Non-blocking & fast: Efficient single HTTP POST request with strict timeouts.

License

MIT