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

@nhogs/table-logger

v0.0.2

Published

A lightweight, zero-dependency, and state-aware Unicode table logger for Node.js.

Readme

@nhogs/table-logger

A lightweight, zero-dependency, and state-aware Unicode table logger for Node.js CLI applications.

License Version

Table Logger is designed to create structured, readable logs in your terminal. Unlike standard console.log or complex table libraries, table-logger focuses on streaming logs. It maintains the visual structure of a table (headers, borders, footers) even as you log events line by line over time.

✨ Features

  • State-Aware: Automatically handles transitions between headers, body lines, and footers.
  • Unicode Drawing: Clean box-drawing characters for a professional look.
  • Streaming Friendly: Designed to log processes as they happen (e.g., file processing, migrations).
  • Built-in Status Helpers: Ready-to-use methods for Success, Error, Warning, Info, Created, etc.
  • TypeScript Support: Written in TypeScript with full type definitions included.
  • Lightweight: Minimal footprint, powered by picocolors for styling.

📦 Installation

npm install @nhogs/table-logger

🚀 Usage

Basic Example

import TableLogger from "@nhogs/table-logger";

// Initialize with default column widths
const logger = new TableLogger();

logger.logHeader("System Synchronization");

// Log standard lines: (Symbol, Status, Message)
logger.logLine("1", "INIT", "Connecting to database...");
logger.logLine("2", "AUTH", "Verifying credentials...");

// Use built-in helpers for colorful status
logger.logSuccess("Database connected successfully");
logger.logInfo("Fetching 500 records");
logger.logWarning("Response time > 200ms");
logger.logError("Failed to parse record #42");

logger.logFooter("Sync Completed");
logger.logEnd(); // Closes the table

Visual Output Preview

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  System Synchronization                                                   ┃
┡━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │   INIT   │ Connecting to database...                                  │
│ 2 │   AUTH   │ Verifying credentials...                                   │
│ ✔ │ success  │ Database connected successfully                            │
│ » │   info   │ Fetching 500 records                                       │
│ ¡ │ warning  │ Response time > 200ms                                      │
│ ¿ │  error   │ Failed to parse record #42                                 │
┗━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
    ┊  Sync Completed                                                       ┊
    ╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯

📖 API Reference

Constructor

const logger = new TableLogger();
  • columnLength (default: 10): Width of the "Status" column.
  • totalLength (default: 224): Total width of the table.

Core Methods

  • logHeader(message: string): Starts a new section with a double-border header.

  • logLine(char: string, status: string, message: string): Logs a standard row.

  • char: Short symbol (1-3 chars) centered in the first column.

  • status: Status text centered in the second column.

  • message: Main content aligned left.

  • logFooter(message: string): Adds a footer section (useful for summaries).

  • logEnd(): Closes the table bottom border. Important: Call this when your process is done.

Helper Methods (Colorized)

These methods act as shortcuts for logLine with predefined symbols and colors:

| Method | Symbol | Color | Usage | | ----------------- | ------ | ----------- | --------------------- | | logSuccess(msg) | ✔ | Green | Successful operations | | logError(msg) | ¿ | Red | Critical failures | | logWarning(msg) | ¡ | Yellow | Alerts | | logInfo(msg) | » | Cyan | General information | | logCreated(msg) | + | Green (Bg) | Resource creation | | logDeleted(msg) | ✘ | Yellow (Bg) | Resource deletion | | logUpdated(msg) | ↯ | Blue (Bg) | Resource updates | | logExists(msg) | ◌ | Cyan (Bg) | Skipped resources |

Summary System

You can push messages to a summary stack and flush them later (e.g., at the end of a script).

logger.logSummary("Processed 50 files");
logger.logSummary("Skipped 2 files");

// ... later ...

TableLogger.flushSummary(); // Prints all summaries in a dedicated table

🎨 Customization

You can inject a custom "dyer" (coloring function) in the constructor if you want to override default styles or strip colors.

import pc from "picocolors";

// Example: Force all borders to be magenta
const logger = new TableLogger(10, 100, pc.magenta);

📜 License

MIT © NHOGS Interactive