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

@dsc-slash/builder

v0.1.4

Published

A plug-in for discord.js that lets you focus on writing code, and not worry about how you're going to register each and every one, as well as handle them!

Readme

/slash command builder

A plug-in for discord.js that lets you focus on writing code, and not worry about how you're going to register each and every one, as well as handle them!

Requirements

  • discord.js >=14.12.0 (is peer dependency of @dsc-slash/builder)
  • hand-tested on Node v23, can't confirm other versions (no unit tests yet)

Getting started

Install the package in your desired directory

To write your commands, create the following files:

// ------ index.ts
import { Client } from "discord.js";
import { SlashCommandHandler } from "@dsc-slash/builder";

const client = new Client({ intents: /* Your Bot's Intents */})
const handler = new SlashCommandHandler()
handler.loadCommands('./place/with/commands/') // or your own path

client.on('interactionCreate', async (interaction) => {
    if(await handler.handleInteraction(interaction)) return
    else throw 'Failed to handle.'
})

client.login(/* Your Bot Token */)
// ------ ./place/with/commands/something.ts
import { SCOPE_GLOBAL, SlashCommandBuilder } from '@dsc-slash/builder/command'
import { string } from '@dsc-slash/builder/options/string' // All option types follow this convention
// Available option types: attachment, boolean, channel, mentionable, numeric, role, string, user
import {choice} from '@dsc-slash/builder/options/choices'

export default new SlashCommandBuilder('some_name')
.setDescription('This is a test command')
.setScope(SCOPE_GLOBAL) // or replace with the guild ID as string
.setOptions(() => [
    string('yourStringOption', 'This is an option').setRequired(false)
    string('anotherStringOption', 'Electric Boogaloo')
    .setRequired(false)
    .setChoices(() => [
        choice('option1', 'Value 1'),
        choice('option2', 'Value 2')
    ])
])
.onInteraction(async (options, interaction) => {
    // TODO Do something with the data. It will be typed!
    if(options.yourStringOption) {
        await interaction.reply(options.yourStringOption)
    }
})

All builder options are based on the Discord API documentation, so if you can

After you've written that, you run:

npx @dsc-slash/migrator

And that's it, the commands are registered!

The migrator package can only add commands as of writing, not remove or edit them. As per the Discord Documentation, adding a command with an existing name will remove the old one.

To run the bot, just use your preferred TS compiler like tsc (you need to have typescript installed globally) or with TypeScript Execute npx tsx ./index.ts