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

@teeny-tiny/discord-rpc

v1.0.0

Published

Just a teeny-tiny discord-rpc alternative.

Readme

@teeny-tiny/discord-rpc

A minimal, lightweight Discord Rich Presence library for Node.js — no bloated dependencies, no fuss, just simple IPC-based Rich Presence support. Perfect for local bots, desktop apps, or small projects.


Features

  • ✅ Minimal & lightweight — no extra dependencies
  • ✅ Full Rich Presence support (setActivity, clearActivity)
  • ✅ Event-based API (ready, error, etc.)
  • ✅ Automatic ping/pong keep-alive
  • ✅ Drop-in replacement for discord-rpc

Installation

npm install @teeny-tiny/discord-rpc

Usage

const RPC = require("@teeny-tiny/discord-rpc");

// Register your Discord App Client ID
RPC.register(process.env.CLIENT_ID);

// Create a new client
const client = new RPC.Client({ transport: "ipc" });

client.once("ready", () => {
  console.log("Discord RPC ready!");

  // Set Rich Presence
  client.setActivity({
    details: "Building 3 bots",
    state: "Working",
    startTimestamp: new Date(),
    largeImageText: "LocalBotify",
    buttons: [
      { label: "Get LocalBotify For Free", url: "https://localbotify.com" }
    ]
  });

  // Clear Rich Presence after 10 seconds
  setTimeout(() => {
    client.clearActivity();
    console.log("Activity cleared");
  }, 10000);
});

// Connect to Discord
client.login({ clientId: process.env.CLIENT_ID });

API

RPC.register(clientId)

Registers your Discord App Client ID globally.

new RPC.Client({ transport: "ipc" })

Creates a new client instance. Currently, only "ipc" transport is supported.

client.login({ clientId })

Connects to the Discord client over IPC. If clientId is not provided, it uses the registered client ID.

client.setActivity(activity)

Sets the Rich Presence activity. Supports all standard fields:

  • details (string)
  • state (string)
  • startTimestamp / endTimestamp
  • largeImageKey, largeImageText
  • smallImageKey, smallImageText
  • buttons (array of { label, url })

client.clearActivity()

Clears the current Rich Presence activity.

Events

  • ready — Fired when the client is connected and ready.
  • error — Fired on connection or IPC errors.
  • disconnected — Fired when the IPC connection closes.
  • Custom Discord events are emitted as cmd strings, e.g., ACTIVITY_JOIN.

Example: Idle Detection

let idleTimer;
const idleThreshold = 60000; // 1 minute
let isIdle = false;

const resetIdleTimer = () => {
  clearTimeout(idleTimer);

  if (isIdle) {
    isIdle = false;
    client.setActivity({ details: "Working" });
  };

  idleTimer = setTimeout(() => {
    isIdle = true;
    client.setActivity({ details: "Idling" });
  }, idleThreshold);
};

["mousemove", "keydown", "mousedown", "scroll"].forEach(event => {
  window.addEventListener(event, resetIdleTimer, true);
});

resetIdleTimer();

Why use @teeny-tiny/discord-rpc?

  • Smaller and faster than the discord-rpc npm package
  • Full control over IPC communication
  • Easy to extend and debug
  • Ideal for local bots, games, or desktop apps

License

Apache-2.0 © 2025 DinoscapeProgramming