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

skyfold

v1.1.1

Published

Yet another discord.js handlers to make your life easier

Readme

  1. Installation
  2. Using Commands
  3. Using Events
  4. Advanced
  5. Credits
  6. Star History

Installation

Installing the stable version from npm.

npm i skyfold@latest discord.js

Or you can use the latest and also the dev version through npm

npm i github:aggelos-007/skyfold discord.js

After you installed the package you are ready to start you journey building your discord bot! You can initiate the client like discord.js has!

import { Client, } from "skyfold";

const client = new Client({
    ...ClientOptions,
});

client.login("TOKEN");

Using Commands

First of all, we need to load all the commands so in your main file you will have to tell SkyFold where to load commands from like this:

import { Client, } from "skyfold";

const client = new Client({
    ...ClientOptions,
    prefixes?: string[] //Optional, required only when you want to use prefix commands
});

client.commandLoader("./commands");

client.login("TOKEN");

Now that all your commands under commands folder will be loaded, it's time to understand how to create them! First of all, starting with the structure, this is the accepted structure:

import { createCommand } from "skyfold";

export const data = createCommand | createCommand[]

Now gong on based the commands, here is how the createCommand function should be structured as:

Prefixed Commands

Here is how the createCommand should look for prefixed commands

createCommand({
    data: new PrefixedCommandBuilder()
    .setName(string) // Optional only when alwaysReply is set to true
    .setAliases(...string) // Optional
    .setDescription(string) // Optional
    .setParams(...ParamBuilder) // Optional, used only for when you want params
    .setAlwaysReply(boolean)
    .validateCmd( 
        (client: Client, msg: Message) => Promise<boolean> | boolean
    ), // Optional, used only when you want to run some code before running the code and if you want to prevent it from working by returning a boolean
    code: (ctx: {
        client: Client;
        msg: Message;
        args: Params[]; // This is based on the params you have put, it returns the right type
    }) => Promise<void> | void;
})

Here is how ParamBuilder class is structured and all the available param types:

new ParamBuilder()
.setName(string) // Optional
.setDescription(string) // Optional
.setRest(boolean) // Required. True = returns an array of the type by getting all the args users provided | False = return the type only
.setRequired(boolean) // Optional
.setType(ParamType) // Required. Need to use ParamType[keyof ParamType]
// Optional. This method is used to handle errors whenever users fail to return a valid type or don't provide a required param
.setErrorHandler( 
    (client: Client, msg: Message, errorType: "missing" | "wrongType") => Promise<void> | void
)

//ParamType Enum
enum ParamType {
    String
    Number
    User
    Member
    Channel
    Role
};

Slash Commands

Here is how the createCommand should look for slash commands

createCommand({
    data: new SlashCommandBuilder() // This is the same with the discord.js builder but with 1 extra method
    .onlyForGuilds(...string) // Optional, makes the slash command guild only and not as global
    code: (ctx: { 
        client: Client;
        int: ChatInputCommandInteraction
    }) => Promise<void> | void;
})

Interaction Commands

Here is how the createCommand should look for interaction commands

createCommand({
    data: new InteractionCommandBuilder()
    .setName(name) // Optional
    .setType(InteractionType) //Optional, default: InteractionType.All. Need to use InteractionType[keyof InteractionType]
    code: (ctx: {
        client: Client;
        int: Interaction; // This interaction type changes to the type you provide in the builder
    }) => Promise<void> | void;
})
// InteractionType enum
enum InteractionType {
    All
    Modal
    Button
    AutoComplete
    RoleSelectMenu
    UserSelectMenu
    StringSelectMenu
    ChannelSelectMenu
    MentionableSelectMenu
};

Context Commands

Here is how the createCommand should look for context menu commands

createCommand({
    data: new ContextMenuCommandBuilder() // This is the same with the discord.js builder but with 1 extra method
    .onlyForGuilds(...string) // Optional, makes the context menu command guild only and not as global
    code: (ctx: {
        client: Client;
        int: ContextMenuCommandInteraction;
    }) => Promise<void> | void;
})

Using Events

First of all, we need to load all the events so in your main file you will have to tell SkyFold where to load commands from like this:

import { Client, } from "skyfold";

const client = new Client({
    ...ClientOptions
});

client.eventLoader("./events");

client.login("TOKEN");

Now that all your events under events folder will be loaded, it's time to understand how to create them! Here is how you should be aiming to create your events:

import { createEvent } from "skyfold";

export const data = createEvents({
    name: keyof ClientEvents, // Required
    once: boolean, // Optional, default: true
    code: (client: Client, ...args: ClientEvents[EventName]) => void | Promise<void>; // Required
});

Advanced

Do you want to change the way all the interactions are handled? Here is everything you need to know about:

const client = new Client({
    ...ClientOptions,
    customHandlers: {
        prefix?: (client: Client, msg: Message) => Promise<void> | void;
        slash?: (client: Client, int: ChatInputCommandInteraction) => Promise<void> | void;
        interactions?: (client: Client, int: Interaction) => Promise<void> | void;
    };
})

Credits

This package was made with love by this guy <3

Star History