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

loggix

v1.0.4

Published

Une bibliothèque de logging moderne et extensible

Readme

Loggix 🚀

A powerful, feature-rich logging library for Node.js applications that combines beautiful formatting with robust error handling and advanced features.

✨ Features

  • 🎨 Beautiful Console Output

    • Colored log levels
    • Emoji support
    • Customizable formatting
    • Progress bars
    • Tables and separators
    • Title formatting
  • 🔍 Advanced Logging

    • Multiple log levels (error, warn, info, debug, verbose)
    • Context and tags support
    • Metadata handling
    • Stack trace formatting
    • Environment awareness
  • 🛡️ Error Handling

    • Automatic error catching
    • Stack trace beautification
    • Node.js internals filtering
    • Custom error formatting
  • 📊 Progress Tracking

    • Customizable progress bars
    • Speed calculation
    • ETA estimation
    • Percentage display
    • Custom characters
  • 💾 File Management

    • Automatic log rotation
    • Size-based rotation
    • Configurable retention
    • Multiple log formats (JSON/Pretty)

🚀 Quick Start

import { Loggix } from 'loggix';

// Create a logger instance
const logger = new Loggix({
  level: 'info',
  colors: true,
  useEmojis: true,
  environment: 'DEV'
});

// Basic logging
logger.info('Application started');
logger.error('Something went wrong', { error: new Error('Oops!') });

// With context and tags
logger.withTag('auth').withMetadata({ userId: 123 })
  .info('User logged in');

// Pretty formatting
logger.separator('double');
logger.title('System Status');
logger.table({
  status: 'running',
  uptime: '2h 30m',
  memory: '1.2GB'
});

// Progress tracking
const progress = logger.createProgressBar({
  total: 100,
  message: 'Processing files',
  showSpeed: true,
  showTimeRemaining: true
});

// Update progress
progress.increment(10);

🎨 Formatting Examples

// Error with stack trace
logger.error(new Error('Database connection failed'));

// Output:
// ❌ ERROR [2024-03-14 10:30:15] Database connection failed
// Error: Database connection failed
//     at Database.connect (/app/db.ts:42)
//     at Server.start (/app/server.ts:15)

// Table output
logger.table({
  'User ID': 123,
  'Status': 'active',
  'Last Login': '2024-03-14'
});

// Output:
// ┌──────────┬────────┐
// │ User ID  │ 123    │
// │ Status   │ active │
// │ Last     │ 2024-03│
// └──────────┴────────┘

// Progress bar
const progress = logger.createProgressBar({
  total: 100,
  message: 'Downloading'
});

// Output:
// Downloading [████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 20% (50 units/s) ETA: 1m 30s

⚙️ Configuration

const logger = new Loggix({
  // Log level
  level: 'info', // error, warn, info, debug, verbose
  
  // Output options
  colors: true,
  useEmojis: true,
  format: 'pretty', // or 'json'
  
  // File options
  logDir: 'logs',
  maxFiles: 5,
  maxSize: '10m',
  
  // Environment
  environment: 'PROD',
  
  // Custom formatters
  customFormatters: [/* ... */]
});

🔧 Advanced Usage

Error Handling

// Errors are automatically caught and formatted
// No additional configuration needed!

// Custom error formatting with context
logger.error(new Error('Custom error'), {
  context: 'Payment',
  tags: ['critical', 'payment'],
  metadata: {
    orderId: '123',
    amount: 99.99
  }
});

// Output:
// ❌ ERROR [2024-03-14 10:30:15] [Payment] [critical, payment] Custom error
// Error: Custom error
//     at PaymentProcessor.process (/app/payment.ts:42)
//     at OrderService.create (/app/order.ts:15)
// Metadata: { orderId: '123', amount: 99.99 }

Progress Tracking

const progress = logger.createProgressBar({
  total: 100,
  message: 'Processing',
  width: 40,
  showPercentage: true,
  showSpeed: true,
  showTimeRemaining: true,
  character: '=',
  incompleteCharacter: '-',
  newLine: true
});

// Update progress
for (let i = 0; i < 100; i++) {
  await processItem();
  progress.increment();
}

Custom Formatting

logger.separator('double');
logger.title('System Report');
logger.table({
  'CPU Usage': '45%',
  'Memory': '2.1GB',
  'Disk Space': '75%'
});

📦 Installation

npm install loggix
# or
yarn add loggix

🔍 TypeScript Support

Full TypeScript support with comprehensive type definitions and interfaces.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

MIT License - feel free to use this library in your projects!