{"id":20510630,"url":"https://github.com/discordware/eris-sharder","last_synced_at":"2026-05-17T02:01:34.410Z","repository":{"id":45292826,"uuid":"101312879","full_name":"discordware/eris-sharder","owner":"discordware","description":"A sharding manager for the JavaScript eris library","archived":false,"fork":false,"pushed_at":"2024-06-17T17:20:33.000Z","size":390,"stargazers_count":74,"open_issues_count":12,"forks_count":46,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2026-05-05T00:07:59.015Z","etag":null,"topics":["bot","cluster","discord","eris","eris-sharder","hacktoberfest","sharding-manager"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discordware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-08-24T15:55:09.000Z","updated_at":"2025-08-25T16:39:07.000Z","dependencies_parsed_at":"2024-06-17T19:16:38.073Z","dependency_job_id":"ec257ab2-acc8-4737-b332-125830246e77","html_url":"https://github.com/discordware/eris-sharder","commit_stats":{"total_commits":257,"total_committers":21,"mean_commits":"12.238095238095237","dds":"0.33852140077821014","last_synced_commit":"94bc01d3c2561c7837f31c82d8248b55523c8b6b"},"previous_names":["discord-sharders/eris-sharder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/discordware/eris-sharder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discordware%2Feris-sharder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discordware%2Feris-sharder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discordware%2Feris-sharder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discordware%2Feris-sharder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discordware","download_url":"https://codeload.github.com/discordware/eris-sharder/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discordware%2Feris-sharder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33053144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","cluster","discord","eris","eris-sharder","hacktoberfest","sharding-manager"],"created_at":"2024-11-15T20:30:14.067Z","updated_at":"2026-05-15T04:01:56.698Z","avatar_url":"https://github.com/discordware.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":["JavaScript"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://discord.gg/Dj6TcYy\"\u003e\u003cimg src=\"https://cdn.discordapp.com/attachments/318948997672992770/363798031771893761/Eris_Sharder_2.png\" width=\"546\" alt=\"eris-sharder\" /\u003e\u003c/a\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://discord.gg/Dj6TcYy\" target=\"_blank\"\u003e\u003cimg src=\"https://discordapp.com/api/guilds/364124474729037824/embed.png\" alt=\"Discord\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/eris-sharder\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/eris-sharder.svg?maxAge=3600\" alt=\"NPM version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/eris-sharder\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/eris-sharder.svg?maxAge=3600\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/eris-sharder\"\u003e\u003cimg src=\"https://badges.greenkeeper.io/Discord-Sharders/eris-sharder.svg\" alt=\"Dependencies\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/eris-sharder\"\u003e\u003cimg src=\"https://travis-ci.org/Discord-Sharders/eris-sharder.svg?branch=dev\" alt=\"Build\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://nodei.co/npm/eris-sharder/\"\u003e\u003cimg src=\"https://nodei.co/npm/eris-sharder.png?downloads=true\u0026stars=true\" alt=\"NPM info\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# About\n\neris-sharder is a powerful sharding manager for the discord Eris library. It uses Node.js's cluster module to spread shards evenly among all the cores.\n\n# Installation and usage\nTo download eris-sharder, run `npm install eris-sharder --save`\n\nTo use eris-sharder, simply copy this code and place it in a file, in the same directory that you ran the npm install in:\n\n```javascript\nconst Sharder = require('eris-sharder').Master;\nconst sharder = new Sharder(token, pathToMainFile, options);\n```\n\n## Options\n| Name  | Description |\n| ------------- | ------------- |\n| `token`  | your discord bot token. It will be used to calculate how many shards to spawn and to pass it on to your main file.  |\n| `pathToMainFile`  | path to a file that exports a class. The class must containt a method called \"launch\". In the constructor the only paramater you should put is for the bot.  |\n| `options.stats` | boolean. When set to true it enables stats output. |\n| `options.webhooks` | Object.```{shard: {id: \"webhookID\", token: \"webhookToken\"}, cluster:{id: \"webhookID\", token: \"webhookToken\"}}```|\n| `options.clientOptions` | A object of client options you want to pass to the Eris client constructor.|\n| `options.clusters` | The number of how many clusters you want. Defaults to the amount of threads |\n| `options.clusterTimeout` | Number of seconds between starting up clusters. Values lower than 5 may lead to an Invalid Session on first shard. |\n| `options.shards` | The number of total shards you plan to run. Defaults to the amount that the gateway reccommends, taking into account `options.guildsPerShard` |\n| `options.firstShardID` | ID of the first shard to start on this instance. Defaults to `0` |\n| `options.lastShardID` | ID of the last shard to start on this instance. Defaults to `options.shards - 1` |\n| `options.debug` | Boolean to enable debug logging.|\n|`options.statsInterval` | Interval to release the stats event in milliseconds. Defaults to every minute\n| `options.name` | Name to print on startup. By default it's \"Eris-Sharder\".|\n| `options.guildsPerShard` | Number to calculate how many guilds per shard. Defaults to 1300. Overriden if you only have 1 shard.|\n\nTo see an example, click [here](https://github.com/Discord-Sharders/eris-sharder#example)\n\n# IPC\neris-sharder supports a variety of IPC events. All IPC events can be used via `process.send({type: \"event\"});`\n\n## Logging\neris-sharder supports the following IPC logging events.\n\n| Name  | Example                                          | Description                      |\n|-------|--------------------------------------------------|----------------------------------|\n| log   | `process.send({name: \"log\", msg: \"example\"});`   | Logs to console with gray color. |\n| info  | `process.send({name: \"info\", msg: \"example\"});`  | Logs to console in green color.  |\n| debug | `process.send({name: \"debug\", msg: \"example\"});` | Logs to console in cyan color.   |\n| warn  | `process.send({name: \"warn\", msg: \"example\"});`  | Logs to console in yellow color. |\n| error | `process.send({name: \"error\", msg: \"example\"});` | Logs to console in red color.    |\n\n## Info\nIn every cluster when your code is loaded, if you extend the Base class you get access to `this.bot`, `this.clusterID`, and  `this.ipc`. `this.ipc` has a couple methods which you can find very useful.\n\n| Name         | Example                                   | Description                                                                           |\n|--------------|-------------------------------------------|---------------------------------------------------------------------------------------|\n| register     | `this.ipc.register(event, callback);`     | Using this you can register to listen for events and a callback that will handle them |\n| unregister   | `this.ipc.unregister(event);`             | Use this to unregister for an event                                                   |\n| broadcast    | `this.ipc.broadcast(name, message);`      | Using this you can send a custom message to every cluster                             |\n| sendTo       | `this.ipc.sendTo(cluster, name, message)` | Using this you can send a message to a specific cluster                               |\n| fetchUser    | `await this.ipc.fetchUser(id)`            | Using this you can search for a user by id on all clusters                            |\n| fetchGuild   | `await this.ipc.fetchGuild(id)`           | Using this you can search for a guild by id on all clusters                           |\n| fetchChannel | `await this.ipc.fetchChannel(id)`         | Using this you can search for a channel by id on all clusters                         |\n\n# Example\n## Directory Tree\nIn this example the directory tree will look something like this:\n```\nProject/\n├── node-modules/\n│   ├── eris-sharder\n|\n├── src/\n│   ├── main.js\n│   \n├── index.js\n```\n\n## Example of main.js\n```javascript\nconst Base = require('eris-sharder').Base;\nclass Class extends Base{\n    constructor(bot) {\n        super(bot);\n    }\n\n    launch() {\n\n    }\n\n}\n\nmodule.exports = Class;\n```\n\n## Example of index.js\n```javascript\nconst Sharder = require('eris-sharder').Master;\nconst sharder = new Sharder(\"someToken\", \"/src/main.js\", {\n  stats: true,\n  debug: true,\n  guildsPerShard: 1500,\n  name: \"ExampleBot\",\n  webhooks: {\n    shard: {\n      id: \"webhookID\",\n      token: \"webhookToken\"\n    },\n     cluster: {\n      id: \"webhookID\",\n      token: \"webhookToken\"\n    }\n  },\n  clientOptions: {\n      messageLimit: 150,\n      defaultImageFormat: \"png\"\n  }\n});\n\nsharder.on(\"stats\", stats =\u003e {\n  console.log(stats);\n});\n```\n\n## Starting the script\n\n```\nnode index.js\n```\n\n## NOTICE\n\nIf you are using pm2 to run your script add the `-- --colors` option to enable the colorful logging.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscordware%2Feris-sharder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscordware%2Feris-sharder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscordware%2Feris-sharder/lists"}