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

dis-warden

v1.1.0-beta.0

Published

An enterprise-grade monitoring and management solution for Discord.js bots, with modular features and multi-webhook support.

Downloads

12

Readme

Dis-Warden 🛡️

Dis-Warden is a comprehensive, enterprise-grade monitoring and management solution for your Discord.js bot. With a fully modular design, you can toggle features on or off and direct notifications to different webhooks, giving you complete control over your bot's operational intelligence.

Keep a watchful eye on your bot's stability, resource consumption, and guild interactions with beautiful, real-time notifications delivered exactly where you want them. 📨

Features ✨

Core Monitoring & Alerts

  • 🚀 Advanced Error Detection: Captures uncaughtException and unhandledRejection events. Can be toggled and sent to a specific errors channel.
  • 🔔 Status Notifications: Get instant alerts when your bot comes online, goes offline, or crashes. Fully configurable.
  • 🖥️ Resource Monitoring: Tracks CPU and memory usage, with alerts for high load and latency. Can be disabled or routed to a performance channel.
  • 📊 Guild Activity Tracking: Logs when your bot joins or leaves a server. Can be toggled and sent to a guild-management channel.

Performance Management

  • ⚙️ Automatic Rate Limiting: Identify and rate-limit users consuming excessive resources.
  • Optimized & Tweaked: The entire codebase is optimized for minimal performance impact.

Developer Experience

  • 🛠️ Modular & Configurable: Enable only the features you need.
  • 🔗 Multi-Webhook Support: Use a different webhook for each feature, or a single global one.
  • 🎨 Customizable Embeds: Tailor the look and feel of every notification.

Installation 📦

Install Dis-Warden using your preferred package manager:

npm install dis-warden
# or
yarn add dis-warden
# or
pnpm add dis-warden

Setup & Usage 🛠️

1. Basic Initialization (Single Webhook)

For a simple setup, provide a global webhookUrl that all enabled features will use.

const { Client, GatewayIntentBits } = require('discord.js');
const Warden = require('dis-warden');

const client = new Client({
  intents: [ /* ... your intents ... */ ]
});

const warden = new Warden(client, {
    // A single webhook for all notifications
    webhookUrl: 'YOUR_GLOBAL_DISCORD_WEBHOOK_URL',
    
    // You can still disable features you don't need
    resourceMonitoring: {
        enabled: false
    }
});

// Activate all enabled monitoring services
warden.watch();

client.login('YOUR_DISCORD_BOT_TOKEN');

2. Advanced Initialization (Multi-Webhook)

Assign a unique webhook to each feature for granular notification routing. If a feature's webhookUrl is not set, it will fall back to the global webhookUrl.

const warden = new Warden(client, {
    // Global fallback webhook (optional if all features have their own)
    webhookUrl: 'YOUR_FALLBACK_WEBHOOK_URL',

    // --- Send errors to the #errors channel ---
    errorLogging: {
        enabled: true,
        webhookUrl: 'YOUR_ERRORS_WEBHOOK_URL'
    },

    // --- Send status updates to the #status channel ---
    statusMonitoring: {
        enabled: true,
        webhookUrl: 'YOUR_STATUS_WEBHOOK_URL',
        onlineMessage: '✅ **Bot is Online** - All systems operational.'
    },
    
    // --- Send resource alerts to the #performance channel ---
    resourceMonitoring: {
        enabled: true,
        webhookUrl: 'YOUR_PERFORMANCE_WEBHOOK_URL',
        pollingInterval: 60000, // Check every 60 seconds
        thresholds: { cpu: 80, memory: 85, latency: 500 }
    },

    // --- Send guild join/leave logs to the #guild-logs channel ---
    guildTracking: {
        enabled: true,
        webhookUrl: 'YOUR_GUILD_LOGS_WEBHOOK_URL'
    },

    // --- Disable performance management ---
    performanceManagement: {
        analytics: false,
        rateLimiter: {
            enabled: false
        }
    }
});

// Activate all the features configured above
warden.watch();

client.login('YOUR_DISCORD_BOT_TOKEN');

3. Manually Logging Errors

Manually logged errors will be sent to the webhook defined in the errorLogging configuration block.

client.on('interactionCreate', async (interaction) => {
    if (!interaction.isCommand()) return;
    try {
        // Some risky operation
    } catch (error) {
        // This will go to your errorLogging.webhookUrl
        warden.logError(error, { title: 'Custom error title' });
        // ...
    }
});

API Reference 📚

new Warden(client, options)

Creates a new Warden instance.

  • client (Client): Your discord.js client instance.
  • options (Object): The configuration object.
    • webhookUrl (String): Optional. A global fallback webhook URL.
    • errorLogging (Object):
      • enabled (Boolean): Default true.
      • webhookUrl (String): Specific webhook for errors.
    • statusMonitoring (Object):
      • enabled (Boolean): Default true.
      • webhookUrl (String): Specific webhook for status.
    • resourceMonitoring (Object):
      • enabled (Boolean): Default true.
      • webhookUrl (String): Specific webhook for alerts.
    • guildTracking (Object):
      • enabled (Boolean): Default true.
      • webhookUrl (String): Specific webhook for guild logs.

warden.watch()

Activates all monitoring services where enabled: true.

warden.logError(error, [options])

Manually logs an error. It will use the webhook specified in errorLogging.

Contributing 🤝

Contributions are welcome! Feel free to submit issues or pull requests to improve Dis-Warden.

License 📄

This project is licensed under the MIT License.