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

loggerl

v1.0.3

Published

Advanced logger with file rotation, optional JSON output, color-coded levels, safe stringify, global console patching, and support for capturing external processes and third-party log files.

Downloads

22

Readme

loggerl

Advanced Node.js logger with:

  • Daily file logging with per-process file names
  • Size-based rotation window (5MB per file, keep last 5 files)
  • Optional JSON output via LOG_JSON=true
  • Colorized console output (info/warn/error/debug)
  • Safe stringify with truncation
  • Global console.* patching
  • Helpers to capture external child process output and tail third-party log files

Install

npm install loggerl

If you're working from source, install dev deps and build:

npm install
npm run build

Usage

import { logger, captureProcess, captureFile } from 'loggerl';

logger.info('Server started');
logger.warn({ slow: true, ms: 350 });
logger.error(new Error('boom'));
logger.debug('only in development');

// Forward a child process output into the logger
import { spawn } from 'child_process';
const child = spawn('node', ['-v']);
captureProcess(child);

// Periodically ingest a third-party log file
captureFile('/var/log/other-app.log', 2000);

Behavior

  • Files are created under ./logs relative to your current working directory.
  • Names: app-<pid>-YYYY-MM-DD-<n>.log.
  • Rotation: when the active file exceeds 5MB, a new file is created; only the most recent 5 are kept for that day.
  • Colorized console output is shown only when not in JSON mode.
  • JSON mode: set LOG_JSON=true to write one JSON object per line to the file. Console color output is disabled in this mode.
  • Debug level is enabled when NODE_ENV=development.

API

  • logger.info|warn|error|debug(message: string | object | number | boolean | null | undefined)
    • Writes to the active log file; also writes colorized line to stdout when not in JSON mode.
  • captureProcess(proc: ChildProcess)
    • Pipes proc.stdout as info and proc.stderr as error into the logger.
  • captureFile(filePath: string, intervalMs = 5000)
    • Every intervalMs, reads the entire file; if it has content, logs: "Logs de archivo <path>: <content>".

Configuration

  • LOG_JSON=true — enable JSON line output (disables colorized console output).
  • NODE_ENV=development — enables debug level.

Notes

  • The module patches global console.* to write through the logger. If you need to avoid this behavior in certain scripts, import dynamically where needed.
  • The log directory is created if missing.

Development

  • Build: npm run build
  • Test: npm test
# Runs TypeScript build, then executes Jest e2e tests
npm test