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

ubfb

v5.0.0

Published

Official client for UBFB (Universal Blacklist For Bots) — a shared, public blacklist of malicious Discord users.

Readme

ubfb

Cliente oficial de UBFB (Universal Blacklist For Bots) — lista negra pública y compartida de usuarios maliciosos de Discord.

npm install ubfb

Uso básico

import { UBFB } from "ubfb";

const ubfb = new UBFB({ name: "MiBot" }); // name/avatarUrl son opcionales, públicos y sin verificar

ubfb.on("sync", (ids) => console.log(`${ids.length} usuarios activos`));
ubfb.on("add", (entry) => console.log("nuevo:", entry.id, entry.reason));
ubfb.on("remove", (userId) => console.log("rehabilitado:", userId));
ubfb.on("error", (err) => console.error(err));

ubfb.connect();

// en cualquier parte, sin llamada de red:
if (ubfb.isBlacklisted(userId)) {
    // ...
}

Caché local

isBlacklisted(), getCachedEntry() y getCachedEntries() leen de una caché en memoria que se mantiene al día desde dos fuentes: cada evento del WebSocket (sync/add/remove) y cada llamada REST que devuelve datos del blacklist (getBlacklistIds, getAllBlacklist, getBlacklistEntry) — no hace falta connect() para que la caché tenga algo, basta con haber pedido los datos por REST alguna vez.

await ubfb.getAllBlacklist();        // también rellena la caché
ubfb.isBlacklisted(userId);          // sin red
ubfb.getCachedEntry(userId);         // sin red — undefined si nunca vimos el detalle completo
ubfb.getCachedEntries();             // todo lo que hay en caché ahora mismo

Un matiz: sync (WS) y getBlacklistIds() (REST) solo traen IDs, no filas completas — así que isBlacklisted() puede ser true mientras getCachedEntry() devuelve undefined, hasta que llegue el detalle completo (por un evento add o por getAllBlacklist()/getBlacklistEntry()).

API REST (funciona sin connect())

import { UBFB, BlacklistReason } from "ubfb";

const ubfb = new UBFB();

await ubfb.getBlacklistIds();           // string[]
await ubfb.getAllBlacklist();           // BlacklistEntry[]
await ubfb.getBlacklistEntry(userId);   // BlacklistEntry | null

await ubfb.fileReport({
    userId,
    reason: BlacklistReason.Estafa,
    authorId, authorUsername,
    intermediaryId, intermediaryUsername,
    proofs: ["https://cdn.discordapp.com/attachments/.../screenshot.png"], // obligatorio, al menos una
});

await ubfb.exportBlacklist("json"); // "json" | "csv" | "sql", como texto plano
await ubfb.getActiveBots();         // { count, bots }

Los métodos REST lanzan UBFBApiError (con .status y .body) si la API responde con un error.

Lista de razones

import { BlacklistReasons } from "ubfb";

[...BlacklistReasons];          // BlacklistReason[], las 21 razones válidas
BlacklistReasons.length;        // 21
BlacklistReasons.toMarkdown();  // lista en markdown, una razón por línea ("- Raider\n- ...")

BlacklistReasons es una instancia de BlacklistReasonList ya poblada con todas las razones — es iterable directamente. Si necesitas un subconjunto, puedes construir la tuya: new BlacklistReasonList([BlacklistReason.Dox, BlacklistReason.Estafa]).toMarkdown().

Opciones del constructor

| Opción | Descripción | |---|---| | baseUrl | Base de la API REST. Por defecto https://ubfb-api.theindiebrand.es. | | wsUrl | URL del WebSocket de presencia. Por defecto, derivada de baseUrl. | | name | Nombre público mostrado en GET /bots/active. No autenticado. | | avatarUrl | Avatar público mostrado junto al nombre. No autenticado. | | reconnectDelayMs | Espera antes de reconectar tras una caída inesperada. Por defecto 5000. |

connect() reconecta automáticamente si la conexión se cae. close() la cierra y desactiva la reconexión.