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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cordify

v1.0.1

Published

An all-in-one Node.js toolkit designed to simplify Discord bot development

Readme

Cordify

An all-in-one Node.js toolkit designed to simplify Discord bot development

npm version

Overview

Cordify combines multiple essential modules into a single, unified package — allowing developers to focus on logic instead of repetitive setup. Built in JavaScript (CommonJS), Cordify aims to be accessible, lightweight, and production-ready.

Key Features

🎯 Command System

A structured and automatic slash command handler inspired by discord-command-kit. Define your commands in a single directory, and Cordify handles registration, permission management, and error safety for you.

💾 JSON Data Store

Cordify includes a lightweight JSON-based datastore that serves as a zero-setup local database. It automatically creates and validates data files, ensuring type consistency and preventing corruption. Perfect for XP systems, guild configurations, and persistent user data.

🔐 Environment Loader

Cordify comes with a built-in environment loader that validates all required Discord-related variables such as TOKEN, CLIENT_ID, and GUILD_ID. It ensures every critical configuration is present before the bot starts, preventing runtime errors.

🛡️ AutoMod

A ready-to-use automoderation system that detects spam, excessive capitalization, link flooding, and more. All rules are easily configurable through a single .config.js file, with safe defaults already included.

🔧 CLI (Command Line Interface)

Cordify provides a CLI tool that allows you to quickly scaffold a new Discord bot project with one command:

npx cordify init my-bot

The CLI automatically generates a recommended folder structure, configuration files, and starter scripts.

Installation

npm install cordify discord.js

Quick Start

1. Initialize a New Project

npx cordify init my-discord-bot
cd my-discord-bot
npm install

2. Configure Your Bot

Edit the .env file with your Discord bot credentials:

TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
GUILD_ID=your_guild_id_here

3. Run Your Bot

npm start

Manual Setup

If you prefer to set up Cordify manually:

const { Client, GatewayIntentBits } = require('discord.js');
const cordify = require('cordify');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent
  ]
});

cordify.env.loadAndValidate();

const datastore = new cordify.DataStore();
const commandHandler = new cordify.CommandHandler(client);
const automod = new cordify.AutoMod({
  spamThreshold: 5,
  capsLimit: 80,
  blockLinks: false
});

client.once('ready', async () => {
  console.log(`Logged in as ${client.user.tag}`);
  
  await commandHandler.loadCommands();
  await commandHandler.registerCommands(
    process.env.TOKEN,
    process.env.CLIENT_ID,
    process.env.GUILD_ID
  );
});

client.on('interactionCreate', async (interaction) => {
  await commandHandler.handleInteraction(interaction);
});

client.on('messageCreate', async (message) => {
  await automod.processMessage(message);
});

client.login(process.env.TOKEN);

Creating Commands

Create a new file in your commands/ directory:

// commands/hello.js
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
  data: new SlashCommandBuilder()
    .setName('hello')
    .setDescription('Greets the user'),
  async execute(interaction) {
    await interaction.reply(`Hello, ${interaction.user.username}!`);
  }
};

Cordify automatically loads and registers all commands in the commands/ directory.

API Reference

DataStore

const datastore = new cordify.DataStore('path/to/data');

datastore.set('users', 'user123', { xp: 100, level: 5 });

const userData = datastore.get('users', 'user123');

datastore.has('users', 'user123');

datastore.delete('users', 'user123');

datastore.increment('users', 'user123_xp', 10);

datastore.push('users', 'user123_achievements', 'first_message');

CommandHandler

const commandHandler = new cordify.CommandHandler(client);

await commandHandler.loadCommands('commands');

await commandHandler.registerCommands(token, clientId, guildId);

await commandHandler.handleInteraction(interaction);

AutoMod

const automod = new cordify.AutoMod({
  spamThreshold: 5,
  spamWindow: 5000,
  capsLimit: 80,
  blockLinks: false,
  ignoreBots: true,
  ignoreRoles: ['Moderator', 'Admin']
});

await automod.processMessage(message);

automod.updateConfig({ spamThreshold: 10 });

automod.disable();
automod.enable();

Environment Loader

cordify.env.load('.env');

cordify.env.validate(['TOKEN', 'CLIENT_ID']);

cordify.env.loadAndValidate();

const token = cordify.env.get('TOKEN');

const hasGuildId = cordify.env.has('GUILD_ID');

Configuration

Create a cordify.config.js file to customize AutoMod settings:

module.exports = {
  automod: {
    spamThreshold: 5,
    spamWindow: 5000,
    capsLimit: 80,
    blockLinks: false,
    ignoreBots: true,
    ignoreRoles: ['Moderator']
  }
};

Examples

Check out the example-bot/ directory for a complete working example demonstrating all Cordify features.

Requirements

  • Node.js: v18 or newer
  • Discord.js: v14+
  • Module Type: CommonJS (require syntax)
  • Operating Systems: Windows, macOS, Linux

Goals

  • ✅ Eliminate redundant setup across Discord bot projects
  • ✅ Provide a plug-and-play experience for both new and advanced developers
  • ✅ Offer a reliable JSON-based datastore with zero configuration
  • ✅ Maintain full compatibility with discord.js
  • ✅ Minimize dependency size and complexity

Example Use Cases

  • Quick bot prototypes without database setup
  • Moderation or utility bots with persistent data
  • Teams standardizing command registration and bot configuration
  • Educational projects or hackathons

Future Plans

  • Optional plugin architecture for advanced extensions
  • Support for YAML and in-memory database adapters
  • Interactive command registration via CLI
  • Integrated testing utilities

Security Notes

  • Cordify does not handle encryption or sensitive data storage
  • JSON Data Store is intended for non-confidential bot information only
  • Developers are responsible for token security and external database connections

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Copyright © 2025 Cordify Developers

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Important: While this software is open-source and free to use, the original design and concept are protected. Users may install and use Cordify in their projects, but creating competing derivative packages or copying the core architecture without proper attribution is prohibited.

Support

For issues and questions, please open an issue on GitHub.


Built with ❤️ by the Cordify team