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

shardwire

v2.2.0

Published

Discord-first bridge between a bot process and external apps over WebSocket.

Readme

shardwire

Typed bridge between a Discord.js bot process and separate app code over WebSocket.

npm npm downloads License: MIT Node

npm · Documentation · Reference


npm install shardwire

The Problem

Keeping every feature inside the same process as the Discord gateway works until it does not: deploys get riskier, resource contention shows up, and you may not want dashboards or automation sharing the exact same runtime as session management.

Shardwire is the small middle layer: expose a bridge from the bot package, connect from another Node process (or a bundler target) with shardwire/client, and move product logic behind the same contracts you would use in a normal internal API—except the transport is WebSocket-oriented for low-latency Discord-shaped traffic.


See It Work

Minimal shape (see docs for complete options and error handling):

// Bot process (Node): create bridge alongside your Client
import { createBotBridge } from 'shardwire';

const bridge = createBotBridge({
	// discord.js client, listen options, secret, ...
});
await bridge.ready();
// App process: connect as a client
import { connectBotBridge } from 'shardwire/client';

const session = connectBotBridge({
	url: process.env.SHARDWIRE_URL!,
	secret: process.env.SHARDWIRE_SECRET!,
});

Install

At runtime, traffic follows your Discord.js configuration (Discord gateway/REST) and any bridge WebSocket server you start. Put the bridge secret and bot credentials in your environment; the library does not add its own outbound analytics. Remove the dependency with npm uninstall shardwire in the consuming project.

npm install shardwire

Requires Node.js 22+.

| Import | Use when | | ------------------ | ------------------------------------------------------------- | | shardwire | Bot-side bridge creation, types shared with the app | | shardwire/client | App-side connector (Node or bundlers that resolve the export) |

Build artifacts live under dist/ on npm; TypeScript types ship with the package.


Getting Started

  1. Read How it works.
  2. Follow Getting started or the tutorial.
  3. Use npm create shardwire@latest if you prefer a ready-made layout.

How It Works

shardwire pairs a bot-hosted bridge with a client that speaks the same protocol. Authentication is based on a shared secret (optionally scoped); mismatches fail closed—treat URL and secret as one unit when debugging.

Migration-friendly modes

  • createBotBridge({ mode: 'split' }) — default two-process architecture.
  • createBotBridge({ mode: 'hybrid', exposeClient: true }) — split mode plus optional bot.client() access to the underlying discord.js client.
  • createBotBridge({ mode: 'single-process' }) — no WebSocket transport; use bot.app() to run app handlers in-process.

For unsupported Discord surface, enable raw passthrough (raw.enabled) and call app.raw(...) / app.actions.runRaw(...) with a strict allowlist.


FAQ

Is discord.js required? This package lists discord.js as a dependency and targets that ecosystem; use the docs for supported versions.

Can I use this without React? Yes. React lives in @shardwire/react, not here.


Contributing

Issues and PRs: github.com/unloopedmido/shardwire (monorepo). Run package verification from packages/shardwire with npm run verify.

License

MIT — see LICENSE in this package.