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

@ninjacut/ninja-logger

v1.4.1

Published

Standalone development logging tool with real-time web UI

Readme

🥷 Ninja Logger

The Ultimate Real-Time Node.js Logging Tool & Web UI

Version License Downloads Size

Ninja Logger is a standalone, real-time log viewer and debugging tool for Node.js applications. It instantly upgrades your development workflow by replacing messy console logs with a beautiful, searchable Web UI.

Stop digging through terminal text. Start logging like a ninja. 🥷


Why Ninja Logger?

Perfect for developers who need:

  • Real-time visibility into long-running processes (API servers, scrapers, AI pipelines).
  • Grouped logging to organize logs by microservice, module, or function.
  • Rich data inspection for JSON objects, arrays, and errors without [Object object].
  • Zero-config setup that works instantly with any Node.js project.

Features

  • Real-Time WebSockets: Logs appear instantly in your browser via Socket.IO.
  • Powerful Filters: Search text, filter by log level (Info, Success, Warning, Error), or isolate specific groups.
  • Smart Grouping: Organize logs by categories like API, Database, CronJob.
  • Beautiful Web UI: Clean, dark-mode interface with collapsible groups and JSON highlighting.
  • Zero-Dependency Client: The logging client is lightweight and won't bloat your app.
  • Production Safe: Auto-disables in production environments with zero overhead.
  • Hot Reload Friendly: Designed to work seamlessly with nodemon and other dev tools.

Installation

1. Install Globally (The Server)

Install the CLI tool globally to run the log viewer server anywhere.

npm install -g @ninjacut/ninja-logger

2. Install Locally (The Client)

Install the library in your project to send logs.

npm install --save-dev @ninjacut/ninja-logger

Quick Start

Step 1: Start the Log Server

Run the following command in a terminal to start the Web UI:

ninja-logger
# Server started at http://localhost:4444

Step 2: Add Logs to Your Code

Import ninjalog and start sending data immediately.

import { ninjalog } from "@ninjacut/ninja-logger/client";

// Basic logging
ninjalog("info", "AuthService", "User logged in successfully");

// Log rich data objects
ninjalog("debug", "OrderProcessor", "Processing order", {
  orderId: "ORD-123",
  items: ["Item A", "Item B"],
  total: 99.99,
});

// Log errors with stack traces
try {
  throw new Error("Payment gateway timeout");
} catch (err) {
  ninjalog("error", "PaymentAPI", err);
}

// Success messages
ninjalog("success", "Database", "Connection established", { host: "127.0.0.1" });

Step 3: Watch the Magic

Open http://localhost:4444 in your browser. You'll see your logs streaming in live!


API Reference

ninjalog(level, group, ...data)

Sends a log message to the running Ninja Logger server.

| Parameter | Type | Description | | --------- | -------- | ---------------------------------------------------------------------- | | level | string | Log severity: 'success', 'info', 'warning', 'error', 'debug' | | group | string | Category name for grouping logs (e.g., 'API', 'DB') | | ...data | any[] | Any number of arguments (objects, strings, arrays, errors) |

disconnect()

Manually closes the socket connection. Useful for cleanup in testing scripts.

import { disconnect } from "@ninjacut/ninja-logger/client";
disconnect();

Configuration

CLI Options

Customize the server when running ninja-logger:

ninja-logger --port 5000 --host 0.0.0.0

| Option | Default | Description | | ------------ | ----------- | ----------------------------- | | -p, --port | 4444 | Port to run the Web UI server | | -h, --host | localhost | Host address to bind to |

Environment Variables

Configure the client via .env or environment variables:

# Connect to a custom server
NINJA_LOGGER_PORT=5000
NINJA_LOGGER_HOST=192.168.1.50

# Force enable in production (use with caution)
NINJA_LOGGER_FORCE=true

# Force disable logging (e.g. in CI/CD)
NINJA_LOGGER_DISABLED=true

Best Practices

Production Safety

Ninja Logger is auto-disabled if NODE_ENV is not set to development. This prevents accidental connection attempts in production.

To use it in non-development environments, you must explicitly set NINJA_LOGGER_FORCE=true.

// It's safe to leave ninjalog() calls in your code!
// They will simply do nothing in production unless forced.
ninjalog("info", "App", "This logs in dev, but is silent in prod");

Screenshots

Ninja Logger Web UI

The Web UI features a robust set of tools for debugging:

  • Filters: Toggle visibility of Success, Info, Warning, Error logs.
  • Search: Real-time fuzzy search through all log data.
  • Collapse All: Quickly collapse groups to see the big picture.
  • Auto-Scroll: Keep up with the latest logs or pause to inspect details.

Contributing

We love contributions! Please feel free to submit a Pull Request on GitHub.

License

MIT © NinjaCut