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

@10abdullahbutt/logger

v1.0.0

Published

A powerful, extensible logger utility for Node.js and TypeScript projects with colored output and Winston-like features

Readme

@10abdullahbutt/logger

A powerful, extensible logger utility for Node.js and TypeScript projects with colored output, Winston-like features, and multiple transport support.

Features

  • 🎨 Colored Output: Beautiful colored console output using chalk
  • 📝 Multiple Formats: Simple, detailed, and JSON formatting options
  • 🚀 Winston-like API: Familiar interface with transports and levels
  • ⚙️ Configurable: Customizable log levels, prefixes, and metadata
  • 📁 File Transport: Built-in file logging support
  • 🔧 Extensible: Easy to add custom transports

Installation

npm install @10abdullahbutt/logger

Basic Usage

import { logger, Logger } from '@10abdullahbutt/logger';

// Simple logging
logger.info('Hello, world!');
logger.error('Something went wrong!');

// With metadata
logger.info('User logged in', { userId: 123, timestamp: new Date() });

Advanced Usage

Custom Logger Configuration

import { Logger, Logger.createFileTransport } from '@10abdullahbutt/logger';

const customLogger = new Logger({
  level: 'debug',
  prefix: 'MyApp',
  colorize: true,
  format: 'detailed',
  timestamp: true
});

// Add file transport
const fileTransport = Logger.createFileTransport('./logs/app.log', 'info');
customLogger.addTransport(fileTransport);

customLogger.debug('Debug message');
customLogger.warn('Warning!');

Pre-configured Loggers

import { debugLogger, productionLogger, developmentLogger } from '@10abdullahbutt/logger';

// Development logger with full debug output
developmentLogger.verbose('Detailed debug info');

// Production logger with JSON format
productionLogger.warn('Production warning');

Custom Transports

import { Logger } from '@10abdullahbutt/logger';

// Custom transport for external logging service
const customTransport = Logger.createCustomTransport((message) => {
  // Send to external service
  console.log('External:', message);
}, 'error');

const logger = new Logger();
logger.addTransport(customTransport);

API Reference

Logger Options

interface LoggerOptions {
  level?: 'debug' | 'info' | 'warn' | 'error' | 'log';
  prefix?: string;
  transports?: Transport[];
  timestamp?: boolean;
  colorize?: boolean;
  format?: 'simple' | 'detailed' | 'json';
}

Methods

  • debug(message, metadata?) - Debug level logging
  • info(message, metadata?) - Info level logging
  • logMessage(message, metadata?) - General logging
  • warn(message, metadata?) - Warning level logging
  • error(message, metadata?) - Error level logging
  • success(message, metadata?) - Success logging (alias for log)
  • verbose(message, metadata?) - Verbose logging (alias for debug)

Winston-like Methods

  • addTransport(transport) - Add a new transport
  • removeTransport(transport) - Remove a transport
  • setLevel(level) - Change log level dynamically

Static Methods

  • Logger.createFileTransport(filePath, level?) - Create file transport
  • Logger.createCustomTransport(writeFn, level?) - Create custom transport

Examples

Different Format Styles

// Simple format (default)
const simpleLogger = new Logger({ format: 'simple' });

// Detailed format
const detailedLogger = new Logger({ format: 'detailed' });

// JSON format for machine parsing
const jsonLogger = new Logger({ format: 'json' });

Environment-based Configuration

const logger = new Logger({
  level: process.env.NODE_ENV === 'production' ? 'warn' : 'debug',
  colorize: process.env.NODE_ENV !== 'production',
  format: process.env.NODE_ENV === 'production' ? 'json' : 'detailed'
});

License

MIT