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

@unchainedshop/logger

v4.6.2

Published

High-performance logging package for the Unchained Engine

Downloads

1,065

Readme

Logger (Unchained Engine)

A high-performance, feature-rich logging package for Unchained Engine with support for multiple formats, log levels, and debug patterns.

Features

  • 🚀 High Performance: Optimized for speed with caching and no-op functions for disabled log levels
  • 🎨 Multiple Formats: Support for both human-readable (unchained) and JSON formats
  • 🔍 Debug Patterns: Flexible DEBUG environment variable with wildcards and exclusions
  • 📊 Log Levels: Five log levels (trace, debug, info, warn, error) with environment-based filtering
  • 💪 TypeScript: Full TypeScript support with type definitions
  • 🔧 Zero Dependencies: Core functionality with minimal external dependencies

Installation

npm install @unchainedshop/logger

Usage

Basic Usage

import { createLogger } from '@unchainedshop/logger';

const logger = createLogger('my-module');

logger.info('Application started');
logger.debug('Debug information', { userId: 123 });
logger.error('Something went wrong', new Error('Details'));

Environment Variables

UNCHAINED_LOG_FORMAT

Controls the output format:

  • unchained (default): Human-readable format with colors
  • json: Machine-readable JSON format
UNCHAINED_LOG_FORMAT=json node app.js

LOG_LEVEL

Sets the minimum log level:

  • verbose or trace: All logs
  • debug: Debug and above
  • info (default): Info and above
  • warn: Warnings and errors only
  • error: Errors only
LOG_LEVEL=debug node app.js

DEBUG

Enables debug logging for specific modules using pattern matching:

  • Wildcards: DEBUG=app:*
  • Exclusions: DEBUG=*,-app:excluded
  • Multiple patterns: DEBUG=app:*,core:*
DEBUG=my-module,other:* node app.js

API

createLogger(moduleName: string): Logger

Creates a logger instance for the specified module.

Parameters:

  • moduleName - The name of the module (used for filtering and display)

Returns: Logger instance with methods: trace, debug, info, warn, error

Default Logger

import { log, defaultLogger } from '@unchainedshop/logger';

// Quick logging with default logger
log('Quick info message');

// Or use the default logger directly
defaultLogger.info('Info message');

Performance

See benchmarks/README.md for detailed performance metrics.

Key performance features:

  • Zero-cost disabled logging: Log levels below the minimum use no-op functions
  • Regex caching: Pattern matching results are cached for speed
  • Optimized hot paths: Critical logging paths are optimized for maximum throughput