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

ferra-link

v0.4.9

Published

A power lavalink wrapper for nodeJS made with shoukaku.

Downloads

8

Readme

Discord npm version npm download GitHub issues

🎶 FerraLink

A Simple but powerful Lavalink Client for your JavaScript Discord Bot!

🔨 Requirements

  • Node.js >= 16.9.0 or Latest.
  • Discord.js >= 14.6.0.

📖 Documentation

📂 Implementation

📦 How to Install FerraLink

Dev: "npm i https://github.com/vkamsingh/Ferralink-Dev.git" //Dev version supports lavalink v4. https://github.com/vkamsingh/Ferralink-Dev#how-to-setup-our-ferralink
Stable: "npm i npm i ferra-link"

How to Setup our FerraLink

Set the Initilizer of Ferralink

Creating in a way like the code example you can import the bot, nodes and shoukakuOptions.

const { Client, GatewayIntentBits } = require("discord.js");
const { FerraLink } = require("ferra-link");
const { Connectors } = require("shoukaku");

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


client.FerraLink = new FerraLink({
    nodes: [{
      name: "Lavalink",
      url: "localhost:2333",
      auth: "youshallpass",
      secure: false
    }],
    shoukakuoptions: {
        moveOnDisconnect: false,
        resumable: false,
        resumableTimeout: 60,
        reconnectTries: 10,
        restTimeout: 60000
    },
    spotify: [{
        ClientID: "Your spotify clientId here",
        ClientSecret: "Your spotify clientSecret here"
    }],
    defaultSearchEngine: "FerralinkSpotify",
}, new Connectors.DiscordJS(client));

client.login("token");

A small example to create play command.

module.exports = {
   name: "play",
   aliases: ["p"],
   run: async (client, message, args) => {
   
const player = await client.FerraLink.createPlayer({
    guildId: message.guild.id,
    voiceId: message.member.voice.channel.id,
    textId: message.channel.id,
    shardId: message.guild.shardId,
    volume: 100,
    deaf: true,
});

const resolve = await player.search(args.join(" "));
const { loadType, tracks, playlistInfo } = resolve;

if (loadType === "NO_MATCHES" || !tracks.length) return message.reply({content: "No match songs result found!"});

if (loadType === "PLAYLIST_LOADED") {
    for (const track of tracks) {
        player.queue.add(track, { requester: message.author });
    }
    if (!player.playing && !player.paused) await player.play();
    message.channel.send({ content: `Added ${player.queue.length} tracks from ${playlistInfo.name}` });
} else if (loadType === "SEARCH_RESULT" || loadType === "TRACK_LOADED") {
    player.queue.add(tracks[0], { requester: message.author });
    if (!player.playing && !player.paused) await player.play();
    message.channel.send({ content: `Queued ${tracks[0].info.title}` });
} else return;
  }
}

Getting the Events (shoukaku)

You can access event with the help of client.FerraLink.shoukaku.on().....

| Event Name | Elements | Description | |:--------------: |:------------------: |:----------------------------: | | ready | name, resumed | Event of the node connection. | | error | name, error | Event of the node error. | | close | name, code, reason | Event of the node close. | | disconnect | name, players, move | Event of the node disconnect. | | debug | name, reason | Event of the node debug. |

Getting the Events (FerraLink)

You can access event with the help of client.FerraLink.on().....

| Event Name | Elements | Description | |:----------------: |:--------------: |:----------------------------: | | trackStart | player, track | Event of the track start. | | trackEnd | player, track | Event of the track end. | | queueEnd | player | Event of the queue end. | | PlayerClosed | player, data | Event of the player close. | | trackException | player, data | Event of the track exception. | | PlayerUpdate | player, data | Event of the player update. | | trackStuck | player, data | Event of the track stuck. | | trackError | player, error | Event of the track error. | | PlayerResumed | player | Event of the player resumed. | | PlayerDestroy | player | Event of the player destroyed.| | PlayerCreate | player | Event of the player create. |

Donations 🧡🧡

You can donate to us to improve our project!

"Buy Me A Coffee"

Contributors

Deivu as the owner of Shoukaku.

Vkamsingh, Corgi as the owner of FerraLink.

Prahar as the maintainer of FerraLink Docs.

Inspired by kazagumo, Poru and erela.js.