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

@kawaz/colorize

v0.2.5

Published

A powerful log colorization tool built with Chevrotain parser for beautiful and readable log output

Downloads

10

Readme

colorize

A powerful log colorization tool built with Chevrotain parser for beautiful and readable log output.

Features

  • Smart Log Parsing: Automatically detects and highlights timestamps, log levels, IP addresses, URLs, HTTP methods/status codes, and more
  • Multiple Themes: Choose from various color themes (github, monokai, dracula, nord, solarized-dark, tokyo-night, production, test)
  • Multiline Support: Intelligently joins multiline log entries like stack traces and JSON objects
  • Relative Time: Shows elapsed time between log entries for performance analysis
  • Timestamp Deduplication: Removes duplicate timestamps from kubectl logs and similar tools
  • Line Buffering: Real-time colorization for streaming logs (tail -f, kubectl logs -f)
  • Fast Performance: Built with Bun for blazing fast processing

Installation

Using npm/bunx (Recommended)

# Run directly without installation
npx @kawaz/colorize
# or
bunx @kawaz/colorize

# Install globally
npm install -g @kawaz/colorize
# or
bun add -g @kawaz/colorize

From source

# Clone the repository
git clone https://github.com/kawaz/colorize.git
cd colorize

# Install dependencies
bun install

# Build the project
bun run build

# Run directly
./dist/colorize.js

Usage

Basic Usage

# Pipe logs through colorize
cat logfile.txt | colorize

# Read from file
colorize < logfile.txt

# Real-time log monitoring
tail -f /var/log/app.log | colorize

# With Docker
docker logs -f container_name | colorize

# With kubectl
kubectl logs -f pod_name | colorize

# Run without installation using npx/bunx
cat app.log | npx @kawaz/colorize
tail -f app.log | bunx @kawaz/colorize -t github

Options

colorize [options]

Options:
  -j, --join-multiline       Join multiline log entries (disables line buffering)
  --dedup-timestamps         Remove duplicate timestamps (e.g., kubectl --timestamps)
  -r, --relative-time        Show relative time between log entries
  --line-buffered            Enable line buffering for real-time output (default: ON)
  -c, --force-color          Force color output even when piping
  -t, --theme <name>         Select color theme (use -t without name to list)
  -h, --help                 Show help message

Examples

# Use GitHub theme with relative time
cat app.log | colorize -t github -r

# Join multiline stack traces
cat error.log | colorize -j

# Force colors when piping to less
cat app.log | colorize -c | less -R

# Process kubectl logs with timestamp deduplication
kubectl logs -f --timestamps pod_name | colorize

Environment Variables

You can set default options using environment variables:

# Set default options (includes theme)
export COLORIZE_OPTIONS="-r -t github --dedup-timestamps"

# Command-line arguments override environment settings
# Use --no- prefix to disable options from COLORIZE_OPTIONS
cat log.txt | colorize --no-dedup-timestamps  # Disables dedup even if set in env

# Force color output
export FORCE_COLOR=1

Themes

Available themes:

  • production (default): High contrast, optimized for terminals
  • github: Clean, GitHub-inspired colors
  • github-dark: Dark version of GitHub theme
  • monokai: Classic Monokai colors
  • dracula: Popular Dracula theme
  • nord: Arctic-inspired Nord palette
  • solarized-dark: Solarized dark variant
  • tokyo-night: Modern Tokyo Night theme
  • test: High contrast for testing

List available themes:

colorize --theme

What Gets Colorized?

  • Timestamps: ISO 8601, compact formats, with optional relative time
  • Log Levels: DEBUG, INFO, WARN, ERROR, FATAL (case-insensitive)
  • IP Addresses: IPv4 and IPv6 with proper highlighting
  • URLs: HTTP/HTTPS URLs
  • HTTP: Methods (GET, POST, etc.) and status codes (200, 404, 500, etc.)
  • Source Info: File paths with line numbers ([src/app.ts:42])
  • Key-Value Pairs: JSON-like key=value or key:value pairs
  • Strings: Quoted strings with escape sequences
  • Numbers: Integers and decimals
  • Booleans: true/false
  • Special Values: null, undefined, NaN, Infinity

Development

# Run in development mode
bun run dev

# Run tests
bun test

# Format code
bun run lint

# Build for production
bun run build

Requirements

  • Bun runtime (v1.0 or later)

License

MIT License - see LICENSE file for details

Author

kawaz

Contributing

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