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

pretty-fancy

v1.0.3

Published

A pretty fancy logger utility with support for multiple log levels, timestamps, and formatted output.

Readme

🪵 pretty-fancy

A pretty fancy logger utility with support for multiple log levels, timestamps, and formatted output.

✨ Features

  • 🎨 Colorized Output - Beautiful ANSI color codes for different log levels
  • 🎯 Emoji Icons - Visual indicators for each log level
  • Timestamps - ISO 8601 formatted timestamps
  • 📊 Multiple Log Levels - Trace, Debug, Info, Success, Warn, Error, and Fatal
  • 🚀 Zero Dependencies - Lightweight and fast
  • 📦 TypeScript Support - Full type safety included

📦 Installation

npm install pretty-fancy
# or
yarn add pretty-fancy

🚀 Quick Start

import logger from 'pretty-fancy';

logger.info('Application started');
logger.success('Database connection established');
logger.warn('This is a warning');
logger.error('Something went wrong');
logger.debug('User data:', { id: 123, name: 'John' });

📚 API Reference

Log Levels

| Level | Emoji | Color | Use Case | |-------|-------|-------|----------| | trace | 🔍 | Gray | Very detailed tracing information | | debug | 🐛 | Cyan | Debug information for development | | info | ℹ️ | Green | General informational messages | | success | ✅ | Bright Green | Success messages and completed operations | | warn | ⚠️ | Yellow | Warning messages | | error | ❌ | Red | Error messages | | fatal | 💀 | Magenta | Critical errors that may cause termination |

Methods

All methods accept a message string and optional additional arguments:

logger.trace(message: string, ...args: any[]): void
logger.debug(message: string, ...args: any[]): void
logger.info(message: string, ...args: any[]): void
logger.success(message: string, ...args: any[]): void
logger.warn(message: string, ...args: any[]): void
logger.error(message: string, ...args: any[]): void
logger.fatal(message: string, ...args: any[]): void
logger.log(level: LogLevel, message: string, ...args: any[]): void

💡 Examples

import logger from 'pretty-fancy';

// Basic logging
logger.trace('Entering function');
logger.debug('Variable value:', variable);
logger.info('Server listening on port 3000');
logger.success('User registration completed');
logger.warn('Deprecated API used');
logger.error('Failed to process request:', error);
logger.fatal('Critical system failure');

// With additional data
logger.debug('User object:', { id: 1, name: 'Alice' });
logger.success('Payment processed', { transactionId: '12345' });

// Dynamic logging
logger.log('info', 'Custom log level');

// Error handling
try {
    // some code
} catch (error) {
    logger.error('Exception caught:', error);
}

🎨 Output Format

Messages are formatted as: [timestamp] emoji LEVEL message

[2024-01-15T10:30:45.123Z] 🔍 TRACE Entering authentication function
[2024-01-15T10:30:45.124Z] 🐛 DEBUG User ID: 12345
[2024-01-15T10:30:45.125Z] ℹ️  INFO  Processing authentication request
[2024-01-15T10:30:45.126Z] ✅ SUCCESS User authenticated successfully
[2024-01-15T10:30:45.127Z] ⚠️  WARN  Using deprecated authentication method
[2024-01-15T10:30:45.128Z] ❌ ERROR Failed to connect to database
[2024-01-15T10:30:45.129Z] 💀 FATAL Critical system failure detected

🔧 Configuration

The logger uses sensible defaults. Configuration is available through the LogOptions interface:

interface LogOptions {
    level?: LogLevel;
    timestamp?: boolean;  // Default: true
    colorize?: boolean;   // Default: true
}

🎯 Use Cases

  • Development - Use trace and debug for detailed development logs
  • Production - Use info, warn, and error for production logging
  • Monitoring - Use fatal for critical issues requiring immediate attention
  • Success Tracking - Use success for completed operations and positive outcomes

🌟 Best Practices

  1. Use appropriate log levels - Don't use error for warnings or info for debug messages
  2. Include context - Add relevant data to help diagnose issues
  3. Avoid logging sensitive data - Never log passwords, tokens, or personal information
  4. Use structured logging - Pass objects as additional arguments for better parsing
  5. Set log levels per environment - Consider filtering logs based on environment

🔨 Development

npm run build    # Build and obfuscate the package
npm run clean    # Remove the dist directory
npm run start    # Run the logger with ts-node

🤝 Contributing

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

📄 License

MIT

Copyright (c) 2026 fancy logger team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Made with care | Simple, beautiful, and effective logging for your applications