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

node-buddy

v3.0.1

Published

A node module that is designed to make your life easier when dealing with errors, logging, and more!

Downloads

14

Readme

node-buddy

A node module that is designed to make your life easier when dealing with errors, logging, and more!


Support


Installation

npm i node-buddy@latest --save


Class Builder

A way that you can log errors to a Discord channel via a Webhook.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | BOOLEAN | useDiscord true or false. | #2 | STRING | If using Discord, set the webhook username here. | #3 | STRING | If using Discord, set the webhook avatarURL here.


Figlify Console Tool

An easier way to use the Figlify module.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | STRING | The word(s) you want figlified | #2 | STRING | The font to use for figlification. | #3 | STRING | The CHALK NPM color you wish to use.


Colorizor Console Tool

A cleaner and better way to log your errors in console.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | STRING | The content you want colorized. | #2 | STRING | This is the color/bgColor the content should be logged in.


Message Discord User Fetch

Fetch a Discord user from a message or it's content.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | CLIENT | Provide your client here (bot, app, client). | #2 | MESSAGE | The message variable you can pull mentions from. | #3 | STRING | A backup ID or args statement when no mentions are provided.


Discord User Fetch

Fetch a Discord user by ID (basic).

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | CLIENT | Provide your client here (bot, app, client). | #2 | STRING | The userID you are trying to fetch info for.


Discord Channel Fetch

Fetch a Discord channel by ID (basic).

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | CLIENT | Provide your client here (bot, app, client). | #2 | STRING | The channelID you are trying to fetch info for.


Discord Guild Fetch

Fetch a Discord guild by ID (basic).

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | CLIENT | Provide your client here (bot, app, client). | #2 | STRING | The guildID you are trying to fetch info for.


Console Errors

A cleaner and better way to log your errors in console.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | STRING | This is the error that is collected. | #2 | STRING | This is the color the error should be logged in.


Webhook Errors

A way that you can log errors to a Discord channel via a Webhook.

| Entry | Type | Definition | |----------------|---------------|---------------| | #1 | STRING | This is the error that is collected. | #2 | STRING | This is the ID of the webhook to send to. | #3 | STRING | This is the TOKEN of the webhook to send to.


Code Example

const nodebuddy = require('node-buddy')
const buddy = new nodebuddy(true, 'NodeBuddy', 'https://seeklogo.com/images/N/nodejs-logo-FBE122E377-seeklogo.com.png')
const Discord = require('discord.js')
const client = new Discord.Client()

client.on('ready', async () => {
    buddy.colorize(`I am now running...`, `blue`)

    let channel = await client.channels.cache.get('848346040511758356')

    if(channel == undefined) {
        buddy.consoleError(`channel variable has returned undefined.`, `red`);
    } else {
        channel.send().catch(e => {
            buddy.webhookError(e, `webhookId`, `webhookToken`);
        });
    }
});

client.login('YOUR_BOT_TOKEN')