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 🙏

© 2024 – Pkg Stats / Ryan Hefner

azuma

v3.0.7

Published

A package that actually syncs your ratelimits across all your clusters on Discord.JS

Downloads

27

Readme

Azuma

A package that actually syncs your ratelimits across all your clusters on Discord.JS

The Shipgirl Project; Azuma

Features

✅ An easy drop in solution for those who wants globally synced ratelimits

✅ Follows the original Discord.JS rest manager, so no breaking changes needed

✅ Supports Discord.JS v13

NOTE

This library is now in "Maintenance" phase. I'm not gonna add new features on it. I'll just fix issues if there is but that's as far as I'll go.

You need to use Kurasuta to make this work as this package depends on it

This is planned to use @discordjs/sharder once it's ready. That's the last update and marks the v4 release

v1.x.x initial release (Latest in 1x branch is version: 1.1.0)

v2.x.x drops support for Discord.JS v12 (Latest in 2x branch is version: 2.1.2)

v3.x.x makes the package ESM only (Current)

Installation

npm i --save azuma

Documentation

https://deivu.github.io/Azuma/?api

Support

https://discord.gg/FVqbtGu #development channel

Example

Running Azuma is the same with Kurasuta, except on you need to change your index.js based on example below

Example of index.js

import { Azuma } from 'azuma';
import { Client } = from 'discord.js';

const KurasutaOptions = {
    client: YourBotClient,
    timeout: 90000,
    token: 'idk'
};
const AzumaOptions = {
    inactiveTimeout: 300000,
    requestOffset: 500
};
// Initialize Azuma
const azuma = new Azuma(new URL('BaseCluster.js', import.meta.url), KurasutaOptions, AzumaOptions);
// If you need to access the Kurasuta Sharding Manager, example, you want to listen to shard ready event
azuma.manager.on('shardReady', id => console.log(`Shard ${id} is now ready`));
// Call spawn from azuma, not from kurasuta
azuma.spawn();

Pro Tip

Azuma also exposes when a request was made, when a response from a request is received, and if you hit an actual 429 via an event emitter, which you can use to make metrics on

import { Client } = from 'discord.js';

class Example extends Client {
  login() {
    this.rest.on('onRequest', ({ request }) => /* do some parses on your thing for metrics or log it idk */);
    this.rest.on('onResponse', ({ request, response }) => /* do some parses on your thing for metrics or log it idk */);
    this.rest.on('onTooManyRequest', ({ request, response }) => /* do some probably, warning logs here? since this is an actual 429 and can get you banned for an hour */);
    return super.login('token');
  }
}

WARNING: DO NOT CHANGE OR RUN ANY FUNCTION FROM THE PARAMETERS. It's designed to be used as read-only values

Example Bot

https://github.com/Deivu/Kongou

Based from my Handling from @Kashima, Made with ❤ by @Sāya#0113