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

buncord-hybrid-sharding

v1.0.6

Published

Enterprise Bun-native sharding manager for Discord bots, featuring Redis heartbeats, rolling restarts, and integrated monitoring.

Readme

Buncord-Hybrid-Sharding

The ultimate Enterprise Bun-native sharding manager for Discord bots. Built for performance, reliability, and scale.

buncord-hybrid-sharding is a ground-up refactor of the hybrid sharding concept, optimized specifically for the Bun runtime. It eliminates all Node.js dependencies, leveraging Bun.spawn and native Bun IPC for ultra-fast, low-overhead clustering.

Key Features

  • Bun-Native Core: Zero Node.js dependencies. Uses Bun.spawn and native IPC for maximum performance.
  • Zero-Downtime Rolling Restarts: Built-in ReClusterManager for updating your bot with zero service interruption.
  • Redis-Backed Heartbeats: Distributed health monitoring using Redis. If a cluster hangs, it's detected and restarted automatically via TTL.
  • Integrated Dashboard API: Built-in monitoring server (port 3001) using Bun.serve to track cluster health and trigger administrative actions.
  • QueueManager Plugin: Advanced control over cluster spawning to respect Discord's rate limits precisely.
  • Resource Efficiency: Hybrid sharding (multiple shards per process) reduces memory overhead by 40-60%.

📦 Installation

bun add buncord-hybrid-sharding

🛠️ Quick Start

1. The Manager (cluster.js)

import { ClusterManager, ReClusterManager, HeartbeatManager, DashboardServer } from 'buncord-hybrid-sharding';

const manager = new ClusterManager(`./bot.js`, {
    totalShards: 'auto',
    shardsPerClusters: 2,
    mode: 'process', // Native Bun processes
    token: 'YOUR_BOT_TOKEN',
});

// Extend with Enterprise features
manager.extend(
    new ReClusterManager(),
    new HeartbeatManager({
        redis: { host: 'localhost', port: 6379 },
        interval: 10000,
    }),
    new DashboardServer({ port: 3001 })
);

manager.on('clusterCreate', (cluster) => console.log(`🚀 Launched Cluster ${cluster.id}`));
manager.spawn();

2. The Client (bot.js)

import { ClusterClient, getInfo } from 'buncord-hybrid-sharding';
import { Client, GatewayIntentBits } from 'discord.js';

const client = new Client({
    shards: getInfo().SHARD_LIST,
    shardCount: getInfo().TOTAL_SHARDS,
    intents: [GatewayIntentBits.Guilds],
});

client.cluster = new ClusterClient(client);

client.on('ready', () => {
    client.cluster.triggerReady();
    console.log(`✅ Cluster ${client.cluster.id} is ready!`);
});

client.login('YOUR_BOT_TOKEN');

📈 Monitoring API

The built-in DashboardServer provides a JSON API for monitoring and management:

  • GET /stats: Unified metrics across all clusters.
  • POST /restart: Trigger a rolling restart.
  • POST /maintenance: Toggle maintenance mode.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details. Portions of this code are based on discord.js and discord-hybrid-sharding, copyright of their respective authors.

Developed with ❤️ by Luigi Colantuono.