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

aqualink

v1.5.2-beta

Published

An Lavalink wrapper, focused in speed, performance, and features, Based in Riffy!

Downloads

1,028

Readme

AquaLink

An Stable, performant, Recourse friendly and fast lavalink wrapper

This code is based in riffy, but its an 100% Rewrite made from scratch...

Why use AquaLink

  • In dev
  • Very Low memory comsuption
  • Built in Queue manager
  • Lots of features to use
  • Lowest CPU Usage
  • Very fast (mine take less than 1 second to load an song!)
  • 1 Player created = ~1 - 0,5 mb per player
  • Auto clean Up memory when song finishes / bot leave the vc
  • Plugin system
  • Lavalink v4 support (din't test v3)
  • Youtube and Spotify support
  • Minimal Requests to the lavalink server (helps the lavalink recourses!)
  • Easy player, node, aqua managing
  • Fast responses from rest and node
  • Playlist support (My mix playlists, youtube playlists)

Docs (Wiki)

  • https://github.com/ToddyTheNoobDud/AquaLink/wiki

  • Example bot: https://github.com/ToddyTheNoobDud/Thorium-Music

Yay, Version 1.5.0 || 1.5.1 || 1.5.2 is released, wow

  • 1.5.2-Beta
  • Actually fixed destroy now (i had forgot the queue handling and deleting)
  • Update undici to 7.2.0
  • Implement undici gargabe collector to REST and FetchImage (this can reduce the overall memory usage, experimental) (reference is This)
  • Made some fixes on Player too
  • Why beta (all features are not complete yet, its on testing)

1.5.1 :

  • Fully fixed destroy and the queue handling for delete, also now it deletes from lavalink...

1.5.0:

  • Optimized memory usage in FetchImage by removing unnecessary code and saving, addressing some memory leaks.
  • Updated AQUA with additional cleanup options, faster response arrays, Remade ConstructResponse and resolve, and improved the UpdateVoice handler.
  • Updated CONNECTION to fix bugs, improve the cleanup system, and Improve speed.
  • Improved cleanup in the NODE manager and fixed issues for VPS.
  • Rewrited the TRACK handler for better speed by removing redundant checks and code.
  • REMADE the PLAYER system to fix bugs, resolve message sending issues, Fixes EventEmitter memory leaks (also Fixes AQUA), remove unnecessary JSDoc comments, rewrite some methods, and enhance cleanup.

How to install

npm install aqualink

pnpm install aqualink

Basic usage

// If you're using Module, use this:
// import { createRequire } from 'module';
// const require = createRequire(import.meta.url);

//const { Aqua } = require('aqualink');



const { Aqua } = require("aqualink");
const { Client, Collection, GatewayDispatchEvents } = require("discord.js");

const client = new Client({
    intents: [
        "Guilds",
        "GuildMembers",
        "GuildMessages",
        "MessageContent",
        "GuildVoiceStates"
    ]
});

const nodes = [
    {
        host: "127.0.0.1",
        password: "yourpass",
        port: 233,
        secure: false,
        name: "localhost"
    }
];

const aqua = new Aqua(client, nodes, {
    send: (payload) => {
        const guild = client.guilds.cache.get(payload.d.guild_id);
        if (guild) guild.shard.send(payload);
    },
    defaultSearchPlatform: "ytsearch",
    restVersion: "v4"
});


client.aqua = aqua;


client.once("ready", () => {
    client.aqua.init(client.user.id);
    console.log("Ready!");
});


client.on("raw", (d) => {
    if (![GatewayDispatchEvents.VoiceStateUpdate, GatewayDispatchEvents.VoiceServerUpdate,].includes(d.t)) return;
    client.aqua.updateVoiceState(d);
});

client.on("messageCreate", async (message) => {
    if (message.author.bot) return;

    if (!message.content.startsWith("!play")) return;

    const query = message.content.slice(6);

    const player = client.aqua.createConnection({
        guildId: message.guild.id,
        voiceChannel: message.member.voice.channel.id,
        textChannel: message.channel.id,
        deaf: true,
    });

    const resolve = await client.aqua.resolve({ query, requester: message.member });

    if (resolve.loadType === 'playlist') {
        await message.channel.send(`Added ${resolve.tracks.length} songs from ${resolve.playlistInfo.name} playlist.`);
        player.queue.add(resolve.tracks);
        if (!player.playing && !player.paused) return player.play();

    } else if (resolve.loadType === 'search' || resolve.loadType === 'track') {
        const track = resolve.tracks.shift();
        track.info.requester = message.member;

        player.queue.add(track);

        await message.channel.send(`Added **${track.info.title}** to the queue.`);

        if (!player.playing && !player.paused) return player.play();

    } else {
        return message.channel.send(`There were no results found for your query.`);
    }
});

client.aqua.on("nodeConnect", (node) => {
    console.log(`Node connected: ${node.name}`);
});
client.aqua.on("nodeError", (node, error) => {
    console.log(`Node "${node.name}" encountered an error: ${error.message}.`);
});

client.login("Yourtokenhere");