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

discordjs-nextgen

v1.4.2

Published

Simple and powerful Discord bot library

Readme

discordjs-nextgen

Turkish Documentation

Simple, fast, and modular Discord bot framework with both ESM and CommonJS support.

Why discordjs-nextgen?

  • Fluent API for quick setup
  • Dynamic and recursive file loading
  • Hybrid command system for Prefix + Slash
  • Middleware support
  • Unified Context abstraction
  • Plugin system for modular extensions

Installation

npm install discordjs-nextgen

Quick Start

import { App, Intents, Logger, cooldown } from 'discordjs-nextgen';

const app = new App({
  intents: Intents.ALL,
});

app
  .use(Logger({
    colors: { info: 'cyan', error: 'red' },
  }))
  .use(cooldown(3))
  .command({ folder: 'commands/hybrid' })
  .button({ folder: 'buttons' })
  .modal({ folder: 'modals' })
  .select({ folder: 'selects' })
  .prefix({ folder: 'commands/prefix', prefix: '!' })
  .slash({ folder: 'commands/slash' })
  .events('events')
  .run('YOUR_DISCORD_TOKEN');

Core Concepts

Hybrid Command

import { HybridCommand } from 'discordjs-nextgen';

const ping: HybridCommand = {
  name: 'ping',
  description: 'Measure latency',
  aliases: ['p'],
  run: async (ctx) => {
    const delay = Date.now() - ctx.createdAt.getTime();
    await ctx.reply(`Pong! Latency: **${delay}ms**`);
  },
};

export default ping;

Button Handler

import { ButtonHandler } from 'discordjs-nextgen';

const verifyButton: ButtonHandler = {
  customId: 'verify_user',
  run: async (ctx) => {
    await ctx.reply({ content: 'Verified!', ephemeral: true });
  },
};

export default verifyButton;

Modal

import { Modal } from 'discordjs-nextgen';

const feedbackModal = Modal.create('feedback_form')
  .title('Feedback')
  .short('name', { label: 'Your name' })
  .paragraph('comment', { label: 'Your comment', min: 10, max: 1000 })
  .onSubmit(async (ctx) => {
    await ctx.reply({
      content: `Thanks ${ctx.values.name}! Your feedback was received.`,
      ephemeral: true,
    });
  });

export default feedbackModal;

Select Menu

import { Select } from 'discordjs-nextgen';

const colorSelect = Select.create('color_pick')
  .placeholder('Choose a color')
  .options([
    { label: 'Red', value: 'red' },
    { label: 'Blue', value: 'blue' },
  ])
  .onSelect(async (ctx) => {
    await ctx.reply(`Selected color: ${ctx.values.color_pick}`);
  });

export default colorSelect;

Context API

ctx normalizes both message and interaction flows:

  • ctx.user
  • ctx.guild
  • ctx.channel
  • ctx.reply(content | options)
  • ctx.deferReply(ephemeral?)
  • ctx.editReply(content | options)
  • ctx.followUp(content | options)
  • ctx.showModal(modal)
  • ctx.values
  • ctx.args
  • ctx.isInteraction
  • ctx.createdAt

Plugin System

app.use({
  name: 'my-plugin',
  setup: (bot) => {
    bot.on('ready', (user) => {
      console.log(`${user.tag} is ready`);
    });
  },
});

API Highlights

App

  • .use(fn | plugin)
  • .command({ folder })
  • .prefix({ folder, prefix })
  • .slash({ folder, guildId? })
  • .button({ folder })
  • .button(customId, callback)
  • .select({ folder })
  • .modal({ folder })
  • .events(folder)
  • .run(token)
  • .login(token)

Helpers

  • Logger(options?)
  • cooldown(seconds)
  • EmbedBuilder
  • ButtonBuilder
  • ActionRowBuilder
  • Modal
  • Select

Notes

  • Discord modals can only be opened from interactions, not regular message events.
  • Prefix, slash, button, modal, and select flows can all share middleware.

License

MIT