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

gupi

v1.1.7

Published

A TypeScript NodeJS API Wrapper for Guilded.gg API

Downloads

32

Readme

gapi / gupi

CI npm Guilded

A TypeScript NodeJS API Wrapper for Guilded.gg API.

image

Currently unstable and in active dev. Use with caution.

The name is gapi but silly google took that name so on npm we use gupi

Design Goals

  • Amazing Scalability!
  • Great developer experience!
  • Extremely flexible/dynamic!

Features

  • [x] Initial Connection
    • [x] Handle closes/Reconnection
  • [x] Advanced RAM control!
    • [x] Add custom props
    • [x] Remove undesired props to save RAM
    • [x] Limit the max amount of items in a collection.
  • [x] Basic Cache control
  • [x] Clean and powerful events system
    • [x] Event listeners that are ran when an event occurs.
    • [x] Useful events available to help debug!
  • [x] Clean and powerful tasks system.
    • [x] Runs a function at a certain interval. Useful for things like unmute and updating bot lists etc.
    • [x] Can be used for cache sweeping to keep your cache optimized for exactly what you want.
  • [x] Clean and powerful monitors system.
    • [x] Runs a function on every message sent. Useful for stuff like auto-moderation or tags.
    • [ ] Easily ignore bots, users, edits, dms.
    • [ ] Powerful permission checks.
  • [x] Clean and powerful inhibitors system
    • [x] Stops a command from running if a requirement fails.
    • [x] Easily add custom inhibitors!
  • [ ] Clean and powerful commands system
    • [x] Powerful argument handling including validating, parsing and modifications.
    • [x] Easily create custom arguments for your specific needs.
    • [x] Command aliases.
    • [x] Cooldowns and allowed uses before cooldown triggers.
    • [x] Argument prompting!
    • [ ] Author and bot permission checks in server AND in channel!
  • [x] Clean and powerful languages system.
    • [x] Built in multi-lingual support.
    • [x] Uses i18next, one of the best localization tools available.
    • [x] Supports nested folders to keep cleaner translation files
  • [x] GH Actions
    • [x] Linter
    • [x] Prettier
    • [x] TSC
  • [x] Event Handlers
  • [ ] 100% API coverage
  • [ ] Custom(Redis) cache support
  • [ ] Step by step guide
  • [ ] GH Actions: Deploy on release
  • [ ] Readme image/logo??
  • [ ] Proxy WS support (Pending until sharding is implemented in Guilded)
  • [ ] Proxy REST support (Pending until Rate Limits are better implemented in Guilded)

Usage

Beginner/Basic

import { Client } from 'gupi';

new Client({ email: 'emailhere', password: 'passwordhere' })
  .on('ready', () => console.log('Successfully connected to gateway'))
  .on('messageCreate', message => {
    if (message.content === '!ping') {
      message.send(`Ping MS: ${Date.now() - message.timestamp}ms`);
    }
  })
  .on('unknown', console.log)
  .connect();

BotClient (Full Command Framework)

// index.ts
import { BotClient } from 'gupi';
import configs from './configs';

// Start it up!
const client = new BotClient(configs).on('ready', () => console.log('Successfully connected to gateway')).connect();

// src/commands/avatar.ts
import { Command, CommandArgument, Message, User, Embed } from 'gupi';

export default class extends Command {
  name = 'avatar';
  aliases = ['pfp'];
  description = '🖼️ View the avatar image for a user or the server.';
  arguments = [
    { name: 'server', type: 'string', literals: ['server'], required: false },
    { name: 'user', type: 'user', required: false },
  ] as CommandArgument[];

  async execute(message: Message, args: { user?: User; server?: 'server' }) {
    // BY DEFAULT WE USE THE USERS OWN URL
    let url = message.author.dynamicAvatarURL({ type: 'Large' });
    // IF THE USER WANTED THE SERVER AVATAR USE IT
    if (args.server && message.team) url = message.team.dynamicAvatarURL({ type: 'Large' });
    // IF A USER WAS REQUESTED, THEN WE USE THAT
    if (args.user) url = args.user.dynamicAvatarURL({ type: 'Large' });

    return message.send(
      new Embed()
        .setAuthor(message.author)
        .setDescription(`[${message.translate('commands/avatar:DOWNLOAD_LINK')}](${url})`)
        .setImage(url),
    );
  }
}

image

Advanced Customizations

Everything below this is to showcase examples of advanced features! They are intentionally written in a way that is confusing to a beginner developer, as it is not meant for you. This is an extreme edge case scenario for bots that scale really big!

// Cache Control!
// Set to 0 to disable caching. Apply to any desired Collection.
client.users.maxSize = 1000;

client.connect();