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 🙏

© 2025 – Pkg Stats / Ryan Hefner

djs-helpers

v1.4.3

Published

A package where you can make different djs builders faster

Downloads

24

Readme

Discord.js Shortcuts

A simple package to create Discord.js embeds and buttons with ease, plus simplified message sending utilities.

Installation

Install the package using npm:

npm install djs-helpers

Then import it in your code:

const { embeds, buttons, send, reply, timestamps } = require('djs-helpers');

Message Utilities

Send messages easily with automatic context detection.

Basic Usage

// For messages
send(message, { content: "Hello!" });
reply(message, { content: "This is a reply" });

// For interactions
send(interaction, { content: "Hello!" });
reply(interaction, { 
    content: "This is a hidden reply",
    hide: true 
});

// With embeds
send(message, {
    embed: embeds.generate({
        title: "My Embed",
        description: "Description here"
    })
});

// With buttons
send(message, {
    content: "Click me!",
    component: buttons.generate({
        label: "Click",
        id: "click-me"
    })
});

Send/Reply Options

  • content - Text content of the message
  • embed - Single embed object
  • embeds - Array of embed objects
  • component - Single component (like a button)
  • components - Array of components
  • file - Single file attachment
  • files - Array of file attachments
  • attachment - Single Discord attachment
  • attachments - Array of Discord attachments
  • hide - (Interactions only) Whether the reply should be hidden

Embeds Helper

Create embeds easily with a simple object structure.

Basic Usage

const myEmbed = embeds.generate({
    title: 'My Embed',
    description: 'This is a description',
    color: 'RED'
});

All Options

  • title - Embed title (max 256 characters)
  • description - Embed description (max 4096 characters)
  • color - Embed color (name, hex, or decimal)
  • timestamp - Add current timestamp if true
  • footerText - Footer text
  • footerIcon - Footer icon URL
  • authorName - Author name
  • authorIcon - Author icon URL
  • thumbnail - Thumbnail image URL
  • image - Main image URL
  • fields - Array or object of fields

Fields Example

// Array format
fields: [
    ['Field Name', 'Field Value', true], // inline
    ['Another Field', 'Another Value', false] // not inline
]

// Object format
fields: {
    1: ['Field Name', 'Field Value', true],
    2: ['Another Field', 'Another Value', false]
}

Embed Example Image

Embed Example

Buttons Helper

Create buttons with automatic action row wrapping.

Basic Usage

const myButton = buttons.generate({
    id: 'my-button',
    label: 'Click Me',
    style: 'PRIMARY'
});

Multiple Buttons

const myButtons = buttons.generate([
    { id: 'button1', label: 'Button 1', style: 'PRIMARY' },
    { id: 'button2', label: 'Button 2', style: 'SECONDARY' }
]);

All Options

  • id - Button custom ID (required for non-link buttons)
  • label - Button text (max 80 characters)
  • style - Button style (PRIMARY/BLUE, SECONDARY/GREY, SUCCESS/GREEN, DANGER/RED, LINK)
  • disabled - Whether the button is disabled
  • emoji - Button emoji
  • url - URL for link buttons

Link Button Example

const linkButton = buttons.generate({
    label: 'Visit Website',
    style: 'LINK',
    url: 'https://example.com'
});

Button Example Image

Button Example

Timestamps Helper

Generate Discord timestamps easily.

Basic Usage

const timestamp = timestamps.generate('02/13/2025', 'SHORT_DATE');

All Formats

  • SHORT_DATE - Short date format (e.g., 02/13/2025)
  • LONG_DATE - Long date format (e.g., February 13, 2025)
  • SHORT_TIME - Short time format (e.g., 1:11 PM)
  • LONG_TIME - Long time format (e.g., 1:11:00 PM)
  • SHORT_DATE_TIME - Short date and time format (e.g., 02/13/2025 1:11 PM)
  • LONG_DATE_TIME - Long date and time format (e.g., February 13, 2025 1:11 PM)
  • RELATIVE - Relative time format (e.g., in 2 days)

Color Support

Colors can be specified in multiple formats:

  • Named colors (e.g., 'RED', 'BLUE', 'GREEN')
  • Hex colors (e.g., '#FF0000')
  • Decimal numbers (e.g., 16711680)

Available Named Colors

  • Basic Colors: RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA
  • Neutrals: BLACK, WHITE, GRAY/GREY
  • Metals: GOLD, SILVER, BRONZE
  • Additional Colors: PURPLE, ORANGE, PINK, BROWN
  • Light Variants: LIGHTBLUE, LIGHTGREEN, LIGHTPINK, etc.
  • Dark Variants: DARKBLUE, DARKGREEN, etc.
  • Special Colors: NAVY, TEAL, OLIVE, MAROON
  • Random Color: RANDOM

Full Documentation

For the full documentation, please visit djs-helpers-docs.vercel.app.

License

MIT © [S3DKing]

Made with ❤️ for Discord.js developers