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

cwk-ds-tools

v1.0.4

Published

Zero-boilerplate Discord.js bot framework with built-in MongoDB, automod, slash commands, and more

Readme

cwk-ds-tools 🚀

npm version License Discord

A zero-boilerplate Discord.js framework with built-in MongoDB, automod, slash commands, and more. Get your bot running in minutes!

Features ✨

  • Zero Boilerplate - Just create commands and go
  • Auto-modlog System - Track joins, leaves, deletions, and more
  • MongoDB Integration - Ready-to-use database connection
  • Automatic Slash Commands - Register commands with zero effort
  • Built-in Utility Commands - Help, ping, serverinfo, and more
  • Folder Auto-creation - No manual setup needed
  • TypeScript Support - Full type definitions included
  • Advanced Interaction Handling - Buttons, modals, and select menus

Installation 📦

npm install cwk-ds-tools
# or
yarn add cwk-ds-tools

Quick Start 🚀

  1. Create a .env file:
TOKEN=your_bot_token_here
MONGO_URI=mongodb://localhost:27017/your_db
OWNER_ID=123456789012345678
MODLOG_CHANNEL_ID=987654321098765432
  1. Create your first command (commands/general/ping.js):
module.exports = {
  name: 'ping',
  description: 'Check bot latency',
  slashCommand: true,
  
  async run(interaction, client) {
    const start = Date.now();
    await interaction.deferReply();
    const end = Date.now();
    
    await interaction.editReply({
      content: `🏓 Pong!\nBot: ${end - start}ms\nAPI: ${client.ws.ping}ms`
    });
  }
};
  1. Start your bot (index.js):
require('dotenv').config();
require('cwk-ds-tools')();

Advanced Usage 🛠️

Command Structure

module.exports = {
  name: 'command-name',
  description: 'Command description',
  slashCommand: true, // Register as slash command
  options: [ // Slash command options
    {
      name: 'user',
      description: 'User to target',
      type: 6, // USER type
      required: true
    }
  ],
  permissions: ['Administrator'], // Required permissions
  ownerOnly: false, // Restrict to owner
  
  async run(interaction, client) {
    // Your command logic here
  }
};

Interaction Handling

Create button handlers in interactions/buttons/:

// interactions/buttons/example.js
module.exports = {
  async execute(interaction, args, client) {
    await interaction.update({
      content: `You clicked with args: ${args.join(', ')}`,
      components: []
    });
  }
};

Events

Create custom event handlers in events/:

// events/guildCreate.js
module.exports = {
  name: 'guildCreate',
  once: false,
  
  async execute(guild, client) {
    console.log(`Joined new guild: ${guild.name}`);
  }
};

Built-in Commands 🔧

| Command | Description | Slash Support | |-------------|--------------------------------------|---------------| | /help | Advanced help menu with pagination | ✅ | | /botinfo | Shows bot statistics and info | ✅ | | /serverinfo| Shows server information | ✅ | | /ping | Checks bot latency | ✅ | | /invite | Gets bot invite link | ✅ |

Auto-modlog System 📝

When MODLOG_CHANNEL_ID is set, the bot automatically logs:

  • Member joins/leaves
  • Message deletions/edits
  • Bans/kicks
  • Channel changes

Example modlog entry: Modlog Example

Database Integration 🗃️

Access Mongoose directly through your commands:

async run(interaction, client) {
  const User = mongoose.model('User');
  const user = await User.findOne({ userId: interaction.user.id });
  // ... use user data
}

Configuration ⚙️

Customize initialization:

require('cwk-ds-tools')({
  commandsDir: './my-commands', // Custom commands directory
  eventsDir: './custom-events', // Custom events directory
  disableSlashCommands: false // Disable slash command registration
});

TypeScript Support 💻

Full type definitions included:

import { CommandInteraction } from 'discord.js';
import { CommandOptions } from 'cwk-ds-tools';

const command: CommandOptions = {
  name: 'ping',
  description: 'Ping command',
  run: async (interaction: CommandInteraction) => {
    await interaction.reply('Pong!');
  }
};

Contributing 🤝

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Support 💬

For help, join our Discord Server or open an issue on GitHub.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by Khanmanan | Buy me a coffee