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

mygourd

v0.1.0

Published

some discord utilities.

Downloads

225

Readme

mygourd 🏳️‍⚧️

some discord utilities.

how it works

so check out this example:

// main.ts
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

import consola from 'consola';
import { Client } from 'discord.js';
import { globAllRouters } from 'mygourd/routers';
import { login } from 'mygourd/utils';
import arkenv from 'arkenv';

const env = arkenv({
  BOT_TOKEN: 'string',
});

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

const baseDir = dirname(fileURLToPath(import.meta.url));
await globAllRouters(client, [`events/**/*.ts`, `interactions/**/*.ts`], baseDir);

await login(client, env.BOT_TOKEN, () => {
  consola.info(`Shutting down!`);
});

// events/login.ts
import consola from 'consola';
import { createEventRouter } from 'mygourd/events';

export const loginEvents = createEventRouter({
  clientReady: () => {
    consola.info(`The bot is ready!`);
  },
});

export const loginEvents2 = createEventRouter({
  clientReady: () => {
    consola.info(`The bot is ready, but in a different router!`);
  },
});

// interactions/commands/ping.ts
import { SlashCommandBuilder } from 'discord.js';
import { createInteractionRouterCommand } from 'mygourd/interactions';

export const pingCommand = createInteractionRouterCommand({
  definition: new SlashCommandBuilder().setName(`ping`).setDescription(`Pings the bot!`),
  handler: async (event) => {
    await event.reply({
      content: `pong`,
      flags: `Ephemeral`,
    });
  },
});

it automatically loads everything and enforces type safety, what more could you want? huzzah!

retrieving information about application commands

since I for the life of me could not figure out an elegant way to make the api yield this data cleanly, I suggest that you use something like this to cache the values of the command data:

import {
  type APIApplicationCommand,
  chatInputApplicationCommandMention,
  Client,
  Routes,
} from 'discord.js';
import { lazy } from 'mygourd/utils';

const commandDataCache = lazy(
  (client: Client<true>) =>
    client.rest.get(Routes.applicationCommands(client.user.id)) as Promise<APIApplicationCommand[]>,
);

// this is an example usage case:
const getCommandMention = async (client: Client<true>, name: string, subcommand?: string) => {
  const cache = await commandDataCache(client);
  const command = cache.find((c) => c.name === name);
  if (command === undefined) return `unknown`;
  return subcommand
    ? chatInputApplicationCommandMention(name, subcommand, command.id)
    : chatInputApplicationCommandMention(name, command.id);
};

if you have any ideas for a better way please do let me know

breaking changes

  • removed the useEnv feature, use the arkenv package instead. here's a modified example from their readme:

    import arkenv from 'arkenv';
    
    const env = arkenv({
      BOT_TOKEN: 'string',
    });

    as a result, the dependency on arktype and consola has been removed as well. be mindful of your packages.