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

@dan_koyuki/discrafterjs

v0.3.1

Published

A Discord.js framework built with TypeScript

Readme

DiscrafterJS

npm version GitHub stars License: MIT

Overview

DiscrafterJS is a framework built on top of Discord.js. This framework was created with the goal of making Discord bot development easier and more structured. Adapting an opinionated coding style and convention system, DiscrafterJS enforces consistency in how commands, events, and configurations are written. By doing so, it reduces ambiguity, improves readability, and helps developers focus more on functionality rather than boilerplate.

Features

  • 🔧 Opinionated structure for commands, events, and helpers
  • ⚡ CLI scaffolder via npx create-discrafter-bot
  • 📦 TypeScript support out of the box (but feels like JS)
  • 🔌 Easy to extend with your own handlers
  • 🛠️ Default helpers dispatcher (optional)

Installation

  • Direct from GitHub

    npm i https://github.com/Danang-Bahtiar/DiscrafterJS.git
  • From NPM Registry

    npm i @dan_koyuki/discrafterjs
  • Using Scaffolder

    npx create-discrafter-bot

Usage

  1. Create discrafter.config.js in the project root:

    // example discrafter.config.js
    import { defineConfig } from "@dan_koyuki/discrafterjs";
    import { GatewayIntentBits } from "discord.js";
       
    const config = defineConfig({
     core: {
       intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
       clientId: "your-client-id",
       discordToken: "your-discord-token",
       ownerId: "your-bot-owner-id-or-your-user-id"
     },
     development: {
       developmentMode: true,
       developmentGuildId: "your-guild-id",
     },
     slashCommand: {
        useDefaultHandler: true,
        // the default handler of slashCommand will search and load file from customDirPath if given.
        customDirPath: "./src/slashCommands",
        globalRegister: false
        guilds: ["guild-id-1", "guild-id-2"]},
     event: {
        useDefaultHandler: true,
        // the default handler of event will search and load file from customDirPath if given.
        customDirPath: "./src/events"
     },
     helper: {
        useDefaultHandler: true,
        // the default handler of helperFunction will search and load file from customDirPath if given.
        customDirPath: "./src/helpers"
     },
     custom: {
        useDefaultInteractionEvent: true,
     },
    });
    
    export default config;
  2. index.js

    import { Discrafter } from "@dan_koyuki/discrafterjs";
    
    const bot = Discrafter.create();
    bot.login();
    
    export default bot;
  3. Creating SlashCommand files

    // src/command/ping.js
    import { Discrafter } from "@dan_koyuki/discrafterjs";
    import { SlashCommandBuilder } from "discord.js";
    import {bot} from "./index.js"
    
    export default Discrafter.SlashCommand({
      data: new SlashCommandBuilder().setName("register").setDescription("Register a player!!"),
      execute: async (client, interaction) => {
        //your logic here
       bot.dispatchHelper("register", interaction);
      },
    });
  4. Creating Event files

    // src/events/clientReady.js
    import { Discrafter } from "@dan_koyuki/discrafterjs"
    
    export default Discrafter.Event({
      name: "clientReady",
      once: true,
      execute: async () => {
        console.log(`Bot logged in successfully as ${this.client.user?.tag}.`);
      }
    })
  5. Creating Helper Function files

    // src/helpers/register.js
    
    import {Discrafter} from "@dan_koyuki/discrafterjs"
    
    export default Discrafter.Helper({
      name: "register",
      type: "Interaction",
      execute: async (interaction) => {
        console.log("Hello, im here to help abstracting register function");
      }
    })

FAQ

  1. I want to add my own handlers, how do i do that?
    "As for current version, the framework doesnt handle the case. However, you can simply turn off the useDefaultHandler on any handler you dont want and call your own handler after creating the bot."

Roadmap

  • ~~v0.3: Documentation & helper function handler~~ (Done)
  • v0.3.5: Colorized logging (might or might not be skipped or moved)
  • ~~v0.4: MongoDB Configuration Support~~ (Scrapped/Moved to different package as plugin)
  • v0.5: Plugin/extension support (e.g., RPGTamerDiscrafter)

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open an issue or PR on GitHub.

License

MIT © Dan