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

@komitech/debux

v0.1.0

Published

A lightweight, flexible error tracking SDK for JavaScript/TypeScript applications

Readme

Debux SDK

A lightweight, flexible error tracking SDK for JavaScript/TypeScript applications.

Features

  • 🚀 Simple initialization and setup
  • 🔍 Customizable error filtering
  • 💾 Offline error caching
  • 🔄 Automatic error recovery
  • 📝 Rich error metadata support
  • 🐛 Debug mode for development

Installation

npm install debux
# or
yarn add debux

Quick Start

import { Debux } from 'debux';

// Initialize the SDK
const debux = Debux.init({
  apiKey: 'your-api-key',
  debug: true,              // Optional: Enable debug logging
  offlineCache: true,       // Optional: Enable offline caching
  filterErrors: (error) => error.message !== 'ignored' // Optional: Filter out specific errors
});

// Basic error capture
try {
  throw new Error('Something went wrong');
} catch (error) {
  if (error instanceof Error) {
    Debux.captureError(error);
  }
}

Configuration Options

The SDK can be initialized with the following options:

interface DebuxOptions {
  apiKey: string;          // Required: Your Debux API key
  debug?: boolean;         // Optional: Enable debug logging (default: false)
  filterErrors?: (error: Error) => boolean;  // Optional: Custom error filter
  offlineCache?: boolean;  // Optional: Enable offline caching (default: false)
}

API Key

The apiKey is required for authentication. You can obtain one by signing up at [your-api-domain].

Debug Mode

Enable debug mode to see detailed logs in the console:

Debux.init({
  apiKey: 'your-api-key',
  debug: true
});

Error Filtering

Filter out specific errors using a custom function:

Debux.init({
  apiKey: 'your-api-key',
  filterErrors: (error) => {
    // Filter out 404 errors
    if (error.message.includes('404')) {
      return false;
    }
    return true;
  }
});

Offline Caching

Enable offline caching to store errors when the network is unavailable:

Debux.init({
  apiKey: 'your-api-key',
  offlineCache: true
});

Error Capture

Basic Error Capture

Debux.captureError(new Error('Something went wrong'));

Capture with Metadata

Debux.captureError(new Error('Payment failed'), {
  userId: '123',
  severity: 'error',
  customData: {
    orderId: 'order_123',
    amount: 99.99
  }
});

Different Severity Levels

// Info level
Debux.captureError(new Error('User logged in'), {
  severity: 'info',
  userId: '123'
});

// Warning level
Debux.captureError(new Error('API response slow'), {
  severity: 'warning',
  customData: { responseTime: 5000 }
});

// Error level
Debux.captureError(new Error('Payment failed'), {
  severity: 'error',
  customData: { orderId: '123' }
});

Best Practices

  1. Initialize Early: Initialize the SDK as early as possible in your application lifecycle.

  2. Error Context: Always include relevant metadata when capturing errors:

    Debux.captureError(error, {
      userId: user.id,
      environment: process.env.NODE_ENV,
      component: 'CheckoutForm'
    });
  3. Error Filtering: Use error filtering to reduce noise:

    Debux.init({
      apiKey: 'your-api-key',
      filterErrors: (error) => {
        // Filter out cancelled requests
        if (error.message.includes('cancelled')) {
          return false;
        }
        return true;
      }
    });
  4. Enable Offline Caching: For web applications that might be used offline:

    Debux.init({
      apiKey: 'your-api-key',
      offlineCache: true
    });

TypeScript Support

The SDK is written in TypeScript and includes type definitions. You'll get full type support out of the box.

Browser Support

The SDK supports all modern browsers:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.