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

crd-node-tools

v0.7.7

Published

A Node.js/TypeScript logging toolkit with file logging, email notifications, webhook alerts, remote API forwarding, and a built-in web admin panel.

Readme

CRD Node Tools

Version Node TypeScript License Author

A TypeScript-first, standalone logging toolkit for Node.js applications. Features file-based logging, SMTP email notifications, configurable webhooks, remote API forwarding, and a built-in web-based admin panel — all in a single package.


Table of Contents


Features

| Feature | Description | | --- | --- | | File Logging | Daily-rotated .log files with configurable level filtering | | Log Levels | tracedebuginfowarningerror | | Console Echo | Optionally mirror log output to stdout | | Email Alerts | SMTP-based error notifications with 5-per-5-minute throttle | | Webhook | POST to any URL (Slack, Discord, etc.) with a JSON template | | Remote API | Forward structured log data to an external endpoint | | Admin Panel | Modern web UI for managing all settings at runtime | | Config File | Persistent JSON config (crd-tools.config.json) | | TypeScript | Full type definitions and strict mode |


Installation

# Clone or copy the crd-node-tools folder into your project
npm install

Or, if published to a registry:

npm install crd-node-tools

Quick Start

import { CrdTools } from 'crd-node-tools';

const crd = new CrdTools();

// Start the admin panel on port 9100
await crd.startAdminPanel();

// Log messages
crd.logger.info('Server started', 'server.ts', 'main');
crd.logger.warning('Memory usage high', 'monitor.ts', 'check');
crd.logger.error('DB timeout', 'db.ts', 'connect', true);
//                                                  ^^^^ sends email

Configuration

On first run, a crd-tools.config.json file is created in the working directory with sensible defaults:

{
  "appName": "My App",
  "appUrl": "http://localhost",
  "adminPort": 9100,
  "logger": {
    "logFolderPath": "logs",        // relative to project root
    "logLevel": "info",             // trace | debug | info | warning | error
    "alsoLogToConsole": false
  },
  "email": {
    "enabled": false,
    "recipientEmail": "",
    "smtp": {
      "host": "",
      "port": 587,
      "secure": false,
      "auth": { "user": "", "pass": "" },
      "fromName": "CRD Node Tools",
      "fromEmail": "noreply@localhost"
    }
  },
  "webhook": {
    "enabled": false,
    "url": "",
    "bodyTemplate": "{ ... }"
  },
  "remoteApi": {
    "enabled": false,
    "endpointUrl": "",
    "bodyTemplate": "{ ... }"
  }
}

Programmatic updates

crd.updateConfig({
  logger: { logLevel: 'debug', alsoLogToConsole: true },
  email: { enabled: true, recipientEmail: '[email protected]' },
});

Logger API

crd.logger.trace(message, file?, func?);
crd.logger.debug(message, file?, func?);
crd.logger.info(message, file?, func?);
crd.logger.warning(message, file?, func?);
crd.logger.error(message, file?, func?, notifyAdmin?);

| Parameter | Type | Description | | --- | --- | --- | | message | string | The log message | | file | string? | Source file name (for context) | | func | string? | Function name (for context) | | notifyAdmin | boolean | (error only) Send email notification |

Log output

[2025-01-15 09:32:14.123] [INFO   ] [server.ts] main() Application started
[2025-01-15 09:32:14.456] [ERROR  ] [db.ts] connect() Connection timed out

Admin Panel

Start the built-in web dashboard:

const port = await crd.startAdminPanel();   // default 9100
console.log(`Admin → http://localhost:${port}`);

The panel provides:

  • General settings — app name, URL, admin port
  • Logger config — log path, level, console echo toggle
  • Email / SMTP — full SMTP configuration with test buttons
  • Webhook — URL + JSON body template with placeholders
  • Remote API — endpoint URL + body template
  • Log Browser — list daily log files from the configured log directory
  • Log Export — download merged logs for a selected date range
  • Quick Start Guide — accordion-based in-panel documentation

Embed in existing Express app

import express from 'express';
import { ConfigManager, AdminPanel } from 'crd-node-tools';

const app = express();
const cfgMgr = new ConfigManager();
const panel = new AdminPanel(cfgMgr);

app.use('/admin', panel.getApp());
app.listen(3000);

Email Notifications

Configure SMTP settings via the admin panel or config file. When notifyAdmin: true is passed to .error(), an email is sent to the configured recipient.

Throttling: Maximum 5 emails per 5-minute window to prevent floods.

// This sends an email if email.enabled = true and SMTP is configured
crd.logger.error('Critical failure', 'payment.ts', 'charge', true);

Webhook

Enable the webhook to POST structured JSON on every log entry (above the level threshold):

{
  "level": "{{level}}",
  "message": "{{message}}",
  "file": "{{file}}",
  "function": "{{function}}",
  "app": "{{app_name}}",
  "time": "{{timestamp}}"
}

Available placeholders

| Placeholder | Value | | --- | --- | | {{level}} / {{severity}} | Log level (e.g. error) | | {{message}} | The log message | | {{file}} / {{filename}} | Source file | | {{function}} / {{function_name}} | Function name | | {{app_name}} | Configured app name | | {{app_url}} | Configured app URL | | {{timestamp}} | ISO timestamp |


Remote API

Forwards log data to an external API endpoint using a customisable JSON body template. Uses the same placeholder system as webhooks.


Architecture

crd-node-tools/
├── package.json
├── tsconfig.json
├── .gitignore
├── README.md
├── LICENSE
└── src/
    ├── index.ts            ← Public API + CrdTools facade
    ├── config.ts           ← Type definitions & defaults
    ├── config-manager.ts   ← Load/save JSON config file
    ├── logger.ts           ← Core file logger + email/webhook/remote
    ├── email-service.ts    ← Nodemailer wrapper with throttling
    ├── admin-panel.ts      ← Express web dashboard (HTML/CSS/JS)
    └── demo.ts             ← Usage example

Scripts

npm run build       # Compile TypeScript → dist/
npm run demo        # Run the demo with ts-node
npm run dev         # Run src/index.ts with ts-node
npm start           # Run compiled dist/index.js (library entry)

Release Flow (npm)

Use this release sequence:

npm version patch
git push
git push --tags

What each step does:

  • npm version patch bumps package.json/lock version and creates a git commit + tag.
  • git push pushes the release commit.
  • git push --tags pushes the version tag.

If you use this repository's GitHub Actions publishing workflow (.github/workflows/publish-npm.yml), publishing is triggered when a GitHub Release is created, so create a Release for the pushed tag.


License

Commercial Proprietary License — © 2025–2026 CommRaDian. See LICENSE for details.