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

log-mess

v1.0.2

Published

Log messages with tags and configuration

Readme

log-mess

Enhanced console.log with tags, persistence, and configuration

npm version License: ISC

A powerful logging utility that extends console.log with tagging, persistence, styling, and flexible configuration options. Perfect for debugging complex applications where you need organized, filterable, and persistent logging.

Features

  • 🏷️ Tagged Logging - Organize logs with custom tags
  • 🎨 Styled Output - Colorful console output with custom styling
  • 💾 Persistent Storage - Messages stored in browser storage for later inspection
  • ⚙️ Flexible Configuration - Enable/disable tags globally or via localStorage
  • 🔄 Message Management - Update or remove logged messages after creation
  • 🌐 Browser Compatible - Works across modern browsers with IE fallback
  • 📦 TypeScript Support - Full TypeScript definitions included

Installation

npm install log-mess

Quick Start

import { logMessage, lm } from "log-mess";

// Basic logging
logMessage("DEBUG", "Hello world!");
lm("INFO", "Short alias works too");

// Styled logging
logMessage({ tag: "ERROR", bg: "red", fg: "white" }, "Something went wrong!");

// Get message controls
const msg = logMessage("STATUS", "Processing...");
msg.update("Processing complete!");
msg.remove(); // Remove from storage

API Reference

logMessage(tag, ...values)

Log a message with a tag.

logMessage("DEBUG", "Debug info", { data: "example" });

logMessage(meta, ...values)

Log a message with metadata configuration.

logMessage(
    {
        tag: "ERROR",
        bg: "red", // Background color
        fg: "white", // Foreground color
        silent: false, // Skip console output if true
    },
    "Error message"
);

Return Value

Both forms return an object with methods to manage the logged message:

const msg = logMessage("INFO", "Hello");

// Update the message content
msg.update("Hello, updated!");

// Remove the message from storage
msg.remove();

Configuration

Global Configuration

import { LogConfig } from "log-mess";

// Disable specific tags
LogConfig.disableTags(["DEBUG", "VERBOSE"]);

// Enable specific tags (overrides disabled)
LogConfig.enableTags(["ERROR", "WARN"]);

// Disable message persistence
LogConfig.disableVariable();

Browser Storage Configuration

You can also control logging via localStorage:

// Disable tags via localStorage
localStorage.setItem("log-mess-disabled", "DEBUG,VERBOSE");

// Enable tags via localStorage (takes precedence)
localStorage.setItem("log-mess-enabled", "ERROR,WARN");

// Disable message storage
localStorage.setItem("log-mess-variable-disabled", "true");

Configuration Priority

The configuration system follows this priority order:

  1. localStorage enabled tags (highest priority)
  2. localStorage disabled tags
  3. Global config enabled tags
  4. Global config disabled tags
  5. Silent flag (lowest priority)

Examples

Basic Usage

import { logMessage } from "log-mess";

// Simple tagged logging
logMessage("API", "Fetching user data...");
logMessage("DB", "Query executed successfully");
logMessage(undefined, "Untagged message");

Styled Logging

// Error styling
logMessage({ tag: "ERROR", bg: "red", fg: "white" }, "Critical error occurred!");

// Success styling
logMessage({ tag: "SUCCESS", bg: "green", fg: "white" }, "Operation completed successfully");

// Warning styling
logMessage({ tag: "WARN", bg: "orange", fg: "black" }, "This is a warning");

Message Management

// Create a status message
const statusMsg = logMessage("STATUS", "Initializing...");

// Update it as work progresses
setTimeout(() => {
    statusMsg.update("Loading configuration...");
}, 1000);

setTimeout(() => {
    statusMsg.update("Ready!");
}, 2000);

// Remove it when no longer needed
setTimeout(() => {
    statusMsg.remove();
}, 5000);

Conditional Logging

import { LogConfig } from "log-mess";

// Only show errors and warnings in production
if (process.env.NODE_ENV === "production") {
    LogConfig.disableTags(["DEBUG", "VERBOSE", "INFO"]);
    LogConfig.enableTags(["ERROR", "WARN"]);
}

// These will be filtered based on configuration
logMessage("DEBUG", "This might not show in production");
logMessage("ERROR", "This will always show when enabled");

Silent Logging

// Log to storage but not to console
logMessage({ tag: "METRICS", silent: true }, "User clicked button", { timestamp: Date.now() });

Browser Compatibility

  • Modern Browsers: Full styling support with CSS console formatting
  • Internet Explorer: Fallback to simple [TAG] format
  • All Browsers: Core logging and persistence functionality

Development

# Install dependencies
npm install

# Run tests
npm test

# Build the project
npm run build

License

ISC License - see LICENSE file for details.