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

status-sharding

v1.9.9

Published

Welcome to Status Sharding! This package is designed to provide an efficient and flexible solution for sharding Discord bots, allowing you to scale your bot across multiple processes or workers.

Downloads

564

Readme

Introduction

Welcome to Status Sharding! This package is designed to provide an efficient and flexible solution for sharding Discord bots, allowing you to scale your bot across multiple processes or workers.

Features

  • Efficient Sharding: The sharding package utilizes an optimized sharding algorithm to distribute bot functionality across multiple shards and clusters.
  • Enhanced Performance: Improve your bot's performance by leveraging the power of parallel processing and multi-threading.
  • Flexible Configuration: Easily configure the number of shards, clusters, and other parameters to suit your bot's needs.
  • Comprehensive Documentation: Detailed documentation and usage examples are provided to help you get started quickly.
  • Scalability: Scale your bot's capabilities by distributing the workload across multiple processes or workers.
  • Customizable: Extend and customize the sharding package to adapt it to your specific requirements.
  • Discord.js Core Library Support: Works seamlessly with discord.js as well as its core sub-libraries (e.g., @discordjs/rest, @discordjs/ws, etc.).
  • Cross Hosting Support: Comming soon!

Comparison

Here's a comparison between Status Sharding, Discord Hybrid Sharding and Discord.js Sharding.

| Feature | Status Sharding | Discord Hybrid Sharding | Discord.js Sharding | | --------------------------- | --------------- | ----------------------- | ------------------- | | Flexible configuration | ✔️ | ✔️ | ✔️ | | Clustering Support | ✔️ | ✔️ | ❌ | | Processes & Workers | ✔️ | ✔️ | ❌ | | Comprehensive documentation | ✔️ | ❌ | ❌ | | Performance optimization | ✔️ | ❌ | ❌ | | Discord.js core lib support | ✔️ | ❌ | ❌ |

Installation

npm install status-sharding
pnpm add status-sharding
yarn add status-sharding

Usage

Basic Cluster Setup

This example demonstrates how to set up a cluster manager with Status Sharding. It works with any client implementation, providing automated shard distribution and cluster management.

// import { ClusterManager } from 'status-sharding';
const { ClusterManager } = require("status-sharding");

const manager = new ClusterManager("./path-to-client.js", {
  mode: "worker", // or process
  token: "very-secret-token", // optional, for auto-calculation leave empty
  totalShards: 1, // leave empty for auto calculation
  totalClusters: 1, // shards are distributed over clusters
  shardsPerClusters: 1,
});

manager.on("clusterReady", (cluster) => {
  console.log(`Cluster ${cluster.id} is ready.`);
});

manager.on("ready", () => console.log("All clusters are ready."));

manager.spawn();

Note: Replace './path-to-client.js' with your actual client file path, and 'very-secret-token' with your Discord bot token.


Usage with discord.js

Here’s a minimal example of using Status Sharding with discord.js. It leverages the ShardingClient class to handle shards automatically.

// import { ShardingClient } from 'status-sharding';
// import { GatewayIntentBits, Events } from 'discord.js';
const { ShardingClient } = require("status-sharding");
const { GatewayIntentBits, Events } = require("discord.js");

const client = new ShardingClient({
  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
});

client.once(Events.ClientReady, () => {
  console.log("Ready!");
});

client.login("very-secret-token");

This setup ensures your bot scales efficiently without requiring manual shard management.


Usage with @discordjs/core

For developers using @discordjs/core, Status Sharding provides ShardingCoreClient to integrate seamlessly with the core library and REST API.

// import { ShardingCoreClient } from 'status-sharding/core';
// import { GatewayDispatchEvents, GatewayIntentBits } from '@discordjs/core';
const { ShardingCoreClient } = require("status-sharding/core");
const { GatewayDispatchEvents, GatewayIntentBits } = require("@discordjs/core");

const client = new ShardingCoreClient({
  token: "very-secret-token",
  gateway: {
    intents: GatewayIntentBits.Guilds | GatewayIntentBits.GuildMembers,
  },
  rest: {
    version: "10",
  },
});

client.once(GatewayDispatchEvents.Ready, () => {
  console.log("Ready!");
});

client.gateway.connect();

This example demonstrates full integration with @discordjs/core, including gateway connection and event handling, while still benefiting from automated shard and cluster management.


For more information, please refer to the documentation.


Credits

  • This clone was created by Digital. The original can be found here.
  • Special thanks to maintainers for their work on the initial package, which served as the foundation for this clone. Their contributions are greatly appreciated.
  • Please note that this clone is an independent project and may have diverged from the original discord-hybrid-sharding package in certain aspects.

Dependencies

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.