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

@theokit/gateway-discord

v0.3.0

Published

Discord (discord.js) platform adapter for @theokit/gateway. ADRs D171, D179.

Readme

@theokit/gateway-discord

Discord platform adapter for @theokit/gateway. Wraps discord.js in the BasePlatformAdapter contract.

Status: 0.1.0 — pre-release.

How inbound arrives

Gateway WebSocket. discord.js holds the connection; events reach onInbound once connect() resolves. There is no webhook to host and nothing for an application to authenticate.

Install

pnpm add @theokit/gateway-discord @theokit/gateway @theokit/sdk discord.js

Usage

import { GatewayRunner } from "@theokit/gateway";
import { DiscordAdapter } from "@theokit/gateway-discord";

const adapter = new DiscordAdapter({
  token: process.env.DISCORD_BOT_TOKEN!,
  // intents defaults to [Guilds, GuildMessages, MessageContent,
  // DirectMessages, DirectMessageReactions]. Without MessageContent
  // the bot receives empty msg.content — silent failure (EC-C).
});

const runner = new GatewayRunner({
  adapters: [adapter],
  handler: async (event, ctx) => {
    await ctx.reply(`got: ${event.text}`);
  },
});

await runner.start();

Limitations (v0.1)

  • Text-trigger commands only. Proper Discord slash commands (registered via Application Commands API) are out of scope — use event.text.startsWith("!cmd") for now.
  • WebSocket only (ADR D179). No webhook-based bot mode.
  • Voice channels not exposed via MessageEvent. Use event.discord?.raw for advanced cases.

Known issue: @types/node@26 and type-aware lint

If you install @types/node@26 (the current latest) and run type-aware lint, or tsc with skipLibCheck: false, you will see an error from a package you never installed:

@sapphire/shapeshift/dist/esm/index.d.mts(1,10): error TS2305:
  Module '"util"' has no exported member 'InspectOptionsStylized'.

It is not this adapter, and it is not discord.js misbehaving. @types/node@26 renamed util.InspectOptionsStylized to InspectContext; @sapphire/shapeshift@4 — which discord.js pulls through @discordjs/builders — still imports the old name. Measured 2026-08-29:

| @sapphire/shapeshift | imports | works on @types/node | |---|---|---| | 4.0.0 (what discord.js installs) | InspectOptionsStylized | ≤ 22 | | 5.0.0 | InspectContext | 26 |

@discordjs/[email protected], the current release, declares ^4.0.0 — so no discord.js version reaches shapeshift 5 yet, and there is no combination that satisfies both type lines.

Fix — one line in your tsconfig.json:

{ "include": ["src", "node_modules/@theokit/gateway-discord/shims/types-node-26.d.ts"] }

That file ships with this package and restores the renamed type. It is opt-in and loaded by nothing — a library that augments Node's own types for everyone changes the type environment of people who never asked. Measured 2026-08-29 in a scratch consumer: @types/node@26 fails to compile without it and passes with it, and @types/node@22 passes either way, since the declaration merges with the interface that already exists there.

Two alternatives, if you would rather not add the file: pin @types/node to ^22, which is what engines.node: >=22.12.0 here is typechecked against, or set skipLibCheck: true — most scaffolds do, though TypeScript's own default is false, which is why this is reachable at all.

Tracked in #81. It closes when @discordjs/builders moves to shapeshift 5; the shim's own header says how you will find out without having to watch for it.

License

Apache-2.0