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

@maqsoodia777/ghostlogger

v1.0.3

Published

A logging utility with a real-time monitoring dashboard.

Readme

GhostLogger

A high-performance logging utility with real-time monitoring, sensitive data masking, and a central dashboard.

Features

  • Real-time Log Monitoring: View your application logs in real-time on the GhostLogger dashboard.
  • Sensitive Data Masking: Automatically mask passwords, API keys, and other sensitive fields.
  • Dynamic Rules Syncing: Sync masking rules directly from your dashboard without redeploying.
  • Sampling Logic: Control the volume of logs sent to the cloud to optimize costs.
  • Express Middleware: Easy integration with Express.js to log and mask incoming request data.
  • Customizable: Configure colors, timestamps, JSON output, and local file logging.

Installation

Install the package via npm:

npm i @maqsoodia777/ghostlogger

Quick Start

1. Configuration

Initialize the logger with your API key and other optional settings:

const {
  configure,
  gLog,
  ghostMiddleware,
} = require("@maqsoodia777/ghostlogger");

configure({
  apiKey: "YOUR_GHOST_API_KEY",
  endpoint: "https://api.ghostlogger.io/api/logs", // Optional: Custom endpoint
  enabled: true,
  colors: true,
  timestamps: true,
  samplingRate: 1.0, // 100% logs (0.0 to 1.0)
  sensitiveKeys: ["password", "token", "secret"], // Default masking keys
});

// Enable automatic syncing of masking rules from the dashboard
gLog.startAutoSync();

2. Basic Logging

Use the gLog object for different log levels:

gLog.info("User logged in", { userId: 123 });
gLog.warn("High memory usage detected", { usage: "85%" });
gLog.error("Database connection failed", new Error("Connection timeout"));
gLog.debug("Query execution time", { ms: 45 });

3. Middleware Integration (Express)

Automatically log and mask sensitive data in incoming requests:

const express = require("express");
const { ghostMiddleware } = require("@maqsoodia777/ghostlogger");

const app = express();
app.use(express.json());

// Apply GhostLogger middleware
app.use(ghostMiddleware);

app.post("/login", (req, res) => {
  // Passwords and tokens in req.body/headers will be automatically masked in logs
  res.send("Logged in!");
});

Advanced Features

Sensitive Data Masking

GhostLogger automatically scans log objects and masks fields matching your sensitiveKeys or custom regex rules synced from the dashboard.

gLog.info("Processing payment", {
  card_number: "1234-5678-9012-3456", // Masked if rule exists
  cvv: "123", // Masked if rule exists
});

Remote Rules Syncing

You can manage masking rules (regex patterns) from the GhostLogger dashboard. Call gLog.startAutoSync() to keep your local instance updated with the latest rules every 5 minutes.

Sampling

Reduce log volume by setting a samplingRate (0.0 to 1.0). For example, a rate of 0.1 will only send 10% of logs to the cloud.

configure({ samplingRate: 0.1 });

Configuration Options

| Option | Type | Default | Description | | :-------------- | :--------- | :------ | :------------------------------------------------ | | apiKey | string | "" | Your GhostLogger project API key. | | enabled | boolean | true | Enable or disable logging. | | colors | boolean | true | Enable colored console output. | | timestamps | boolean | true | Include timestamps in logs. | | json | boolean | false | Output logs in JSON format to console. | | samplingRate | number | 1.0 | Probability of sending logs to SaaS (0.0 to 1.0). | | sensitiveKeys | string[] | [] | List of keys to always mask. | | endpoint | string | "" | SaaS API endpoint for log delivery. | | filePath | string | "" | Local file path to save logs. | | maskAll | boolean | false | If true, masks all fields in the data object. |

Dashboard

Access your logs and manage rules at ghostlogger.io.