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

easyhook.js

v1.1.6

Published

Easily Create, Edit, and send discord.js webhooks!

Readme

easyhook

Easily create, edit, and send discord.js webhooks!

I will try to keep this as updated as I can!

Before someone messages me angrily saying "Maxson, we could already do this!," I want to clarify, this is only meant to make the process a little faster, and anyone is welcome to edit the source code!

Documentation:

First, lets create a webhook, this is the easy part:

const { create } = require('@maxson/easyhook');

//create(channel, 'name', 'avatarURL');
create(channel, 'EasyHook Webhook', 'https://i.imgur.com/kM0vh1x.png');
//Channel could be any valid channel 
//The name will be whatever the webhook will be called, call it something 
//simple, and don't worry about it too much, it can be overidden later.
//The avatar can be any valid image url

Easy(hook), right?

Lets get to editing the webhook:

const { edit } = require('@maxson/easyhook');

//edit(channel, webhook, {options});
edit(channel, 'EasyHook Webhook', {
  newName: 'EasyWebhook',
  newAvatar: 'https://i.imgur.com/wJdmpIT.png',
  newChannel: message.channel
});
//This is pretty straight forward.
//Channel = the channel the webhook is located in currently
//Webhook = the name of the webhook you want to search for!
//newName = the new name for the webhook (pretty straight forward)
//newAvatar = Do I even have to explain this one? It's the new avatar URL
//newChannel = used to reassign the webhook to a new channel
//Note: None of these fields are required!

This next one is the big Kahuna, and most likely the one that will be used the most:

The last two didn't need that much explaining, however, this one is a little different, with more usability, comes more complication!

Essentially, this will search for the desired webhook, and if it doesn't exist, it will create it (and then send it).

I warn you, it is always better to create the webhook first!

channel = The channel to search/create the webhook in. webhook = The webhook to search for (use the webhook's name) options:

If sending a simple text message:

  options.username = username override for the webhook
  options.avatar = avatar override for the webhook
  options.content = content of a the message you want to send

Embed: For info on how to structure embeds (properly), click here. NO, you can't use the built in discord.js embed builder, sorry not sorry.

  options.username = username override for the webhook
  options.avatar = avatar override for the webhook
  options.color = hex color code (only if using embed) without #
  options.title = title of the embed
  options.description = description of the embed
  options.footer = footer of the embed
  options.author = author of the embed
  options.image = URL of image
  options.thumbnail = URL of thumbnail
  options.fields = additional fields (max 25)
  

If include options.content in the embed, it will simply send both.

Example:

const { hook } = require('@maxson/easyhook');

hook(channel, 'EasyWebhook', {
  username: 'Welcomer',
  avatar: 'https://linkto.avatar.com/avatar.png',
  content: 'Welcome to our server!',
  color: '2E8B57',
  title: 'Example Title',
  description: 'Example Description',
  footer: {
    text: 'This is a footer',
  },
  author: {
    name: 'This is an author'
  },
  image: 'https://linkto.image.com/image.png',
  thumbnail: 'https://linkto.image.com/image.png',
	fields: [
		{name: 'Example Field', value: 'Example Field Value', inline: true},
		{name: 'Example Field 2', value: 'Example Field Value 2'}
	]
})

DISCLAIMER

This is not recommended for users who do not know how webhooks function, it is my advice to you beginners out there to not only learn how to do everything that this package will do (yes, that means doing it the long way), but to actually do that until it sticks with you. This package is only here to speed the proccess along for experienced people!