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

@onurege3467/log

v2.1.0

Published

High-performance, enterprise-ready TypeScript logger with Worker Threads, Async Context Tracking, and Sensitive Data Redaction.

Readme

@onurege3467/log 🚀

An enterprise-ready, high-performance logging library for Node.js. Optimized for production with Worker Threads, Sensitive Data Redaction, and Asynchronous Context Tracking. Built with TypeScript for full type safety.

npm version License: MIT


🌟 Elite Features

  • 🧵 Worker Threads: Offload serialization and I/O to background threads. Near-zero overhead on your main event loop.
  • 🛡️ Ultra-Security Redaction: Automatically masks passwords, API keys, and sensitive patterns (Stripe, AWS, Credit Cards) even inside strings and deep objects.
  • 🆔 Async Context Tracking: Automatically attach requestId or userId to all logs within a request flow using Node.js AsyncLocalStorage.
  • 🔌 Modular Transport System: Easily extend logging to Console, File, or your own custom transports.
  • 📜 Smart Error Serialization: Properly serializes Error objects, including stacks, hidden properties, and custom metadata.
  • 🌐 Auto-Environment Detection: Intelligently switches between human-readable (Dev) and optimized JSON (Prod) formats.
  • 🔄 Safe & Reliable: Built-in protection against circular references and extremely deep objects.
  • High Performance: Features time caching and hot-path optimizations to rival libraries like Pino.

📦 Installation

npm install @onurege3467/log

🚀 Quick Start

Basic Usage

import { CustomLogger } from '@onurege3467/log';

const logger = new CustomLogger();

logger.info('Server started on port 3000');
logger.warn('Low disk space', { available: '15%' });
logger.error('Database connection failed', new Error('Timeout'));

Production Mode (Zero-Config)

In production (NODE_ENV=production), the logger automatically enables Worker Threads and JSON formatting for ELK/Datadog compatibility.

// Automatically optimized for Production
const logger = new CustomLogger(); 

🛡️ Sensitive Data Protection (Redaction)

The logger automatically scrubs sensitive information from log messages and metadata.

logger.info('Connecting to service', { 
  apiKey: 'AKIA1234567890ABCDEF', // Automatically masked
  password: 'super-secret-pass'   // Automatically masked
});

// String pattern detection
logger.info('User requested: https://my-app.com/api?token=secret-123');
// Output: User requested: https://my-app.com/api?token=[REDACTED]

🆔 Asynchronous Context Tracking

Trace a request's logs through different functions without passing IDs manually.

logger.runWithContext({ requestId: 'req-123', userId: 42 }, () => {
  doSomething(); // Any logger call inside here will include requestId and userId
});

function doSomething() {
  logger.info('Performing action'); 
  // Output includes: {"requestId":"req-123","userId":42}
}

🧵 Worker Threads Performance

For high-traffic applications, enable Worker Threads to keep your application snappy.

const logger = new CustomLogger({
  useWorker: true // Processes logs in a separate thread
});

⚙️ Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | prefix | string | '' | Add a prefix to all log messages | | timestamp | boolean | true | Enable/disable timestamps | | output | string | 'console' | 'console', 'file', 'both', 'custom' | | useWorker | boolean | false | Enable background worker thread (true in Prod) | | sensitiveKeys | string[] | [...] | Custom keys to be redacted | | silent | boolean | true | Fail-safe mode: logger errors won't crash app |

Custom Log Levels

logger.addLevel({
  name: 'success',
  priority: 1,
  color: 'green',
  symbol: '✅'
});

logger.success('Operation complete!');

📁 File Logging

High-performance file logging with rotation and compression.

const logger = new CustomLogger({
  fileLogging: {
    enabled: true,
    path: './logs',
    filename: 'app.log',
    rotation: 'daily',
    maxFiles: 10,
    format: 'json'
  }
});

📊 Performance Comparison

| Library | Total Overhead | Context Support | Worker Threads | |---------|---------------|-----------------|----------------| | @onurege3467/log | Near-Zero | Native | Yes | | winston | Medium | via Plugins | No | | pino | Ultra-Low | Native | via Extreme Mode |


🧪 Testing

npm run test:all

🔄 Changelog

v2.1.0

  • 💿 Disk Persistence: lite-fs disk mode ile gerçek dosya yazma
  • 📦 Updated Dependencies: lite-fs v3.0.0'a güncelleme
  • 🛠️ Improved File Logging: Persistent logging desteği

v2.0.0

  • 🚀 Worker Threads: High-performance async logging
  • 🔄 Async Context: Request tracing and correlation
  • 🛡️ Redaction: Sensitive data protection
  • 📊 Advanced Features: Compression, rotation, multiple formats

v1.0.0

  • 🎯 Initial Release: Basic logging functionality

📄 License

MIT © onure9e