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

jt-debugger

v1.0.0

Published

A features rich JavaScript & TypeScript debugger

Readme

JT-Debugger

A feature-rich JavaScript & TypeScript debugger with advanced logging, profiling, and memory tracking capabilities.

made with love 💖 by @Gurveer

Features

  • 🎯 Multiple Log Levels (DEBUG, INFO, WARN, ERROR, SUCCESS)
  • 📝 File-based Logging with Rotation
  • 🔍 Function Performance Tracking
  • 📊 Memory Usage Monitoring
  • ⏱️ Execution Time Profiling
  • 🎨 Customizable Log Formatting
  • 🔎 Log Filtering
  • 🌐 Remote Logging Support
  • ⚡ Asynchronous Function Support

Installation

npm install jt-debugger

Basic Usage

import Debugger from 'jt-debugger';

// Initialize with default options
const debug = new Debugger();

// Basic logging
debug.info('Application started');
debug.debug('Debug message');
debug.warn('Warning message');
debug.error('Error occurred');
debug.success('Operation successful');

Advanced Configuration

const debug = new Debugger({
    enable: true,                // Enable/disable logging
    logToFile: true,            // Save logs to file
    logFilePath: 'debug.log',   // Log file path
    logLevel: 'DEBUG',          // Minimum log level
    maxLogSize: 5 * 1024 * 1024,// Max log file size (5MB)
    maxLogFiles: 5,             // Number of log files to keep
    colors: {                   // Custom colors for log levels
        DEBUG: 'blue',
        INFO: 'cyan',
        WARN: 'yellow',
        ERROR: 'red',
        SUCCESS: 'green'
    },
    timeFormat: 'ISO',          // 'ISO' or 'locale'
    filterPattern: '^Test'      // RegExp pattern for filtering logs
});

Function Performance Tracking

// Track function execution time and parameters
const myFunction = debug.trackFunction(async (param1, param2) => {
    // Your function logic here
    return result;
}, 'myCustomFunctionName');

// The tracked function will log:
// - Function call with parameters
// - Execution time
// - Return value or error

Memory Usage Monitoring

// Get memory snapshots
const memorySnapshots = debug.getMemoryUsage();

// Clear memory usage history
debug.clearMemoryUsage();

Dynamic Log Level and Filtering

// Change log level at runtime
debug.setLogLevel('INFO');

// Set or update filter pattern
debug.setFilterPattern('^API');

// Remove filter
debug.setFilterPattern(null);

API Reference

Constructor Options

| Option | Type | Default | Description | | ------------- | -------------- | ----------- | ---------------------------- | | enable | boolean | true | Enable/disable logging | | logToFile | boolean | false | Save logs to file | | logFilePath | string | 'debug.log' | Log file path | | logLevel | string | 'DEBUG' | Minimum log level | | maxLogSize | number | 5MB | Max log file size | | maxLogFiles | number | 5 | Number of log files to keep | | colors | object | {...} | Custom colors for log levels | | timeFormat | string | 'ISO' | Timestamp format | | filterPattern | string|RegExp | null | Log filter pattern |

Methods

  • debug(message, ...args): Log debug message
  • info(message, ...args): Log info message
  • warn(message, ...args): Log warning message
  • error(message, ...args): Log error message
  • success(message, ...args): Log success message
  • trackFunction(fn, fnName?): Track function performance
  • getMemoryUsage(): Get memory usage snapshots
  • clearMemoryUsage(): Clear memory usage history
  • setLogLevel(level): Change log level
  • setFilterPattern(pattern): Set log filter pattern

TypeScript Support

The package includes TypeScript definitions and supports type checking out of the box.

import Debugger from 'jt-debugger';

interface Config {
    name: string;
    value: number;
}

const debug = new Debugger();
debug.info('Config:', { name: 'test', value: 42 } as Config);

License

MIT