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

discord-info-lookup

v1.0.6

Published

A discord info lookup tool for discord users and guilds.

Readme

discord-info-lookup

This package utilises the Discord API to retrieve information about users and guilds using the user's or guild's ID. This reduces the hassle of directly interacting with Discord API and allows for easier retrieval of information. The package were originally made because I can't be assed to do it myself and I wanted to make it easier for others (and myself) to use this package.

Installation

Using NPM:

npm install discord-info-lookup

Or using Bun:

bun install discord-info-lookup

Usage

const { getUser, getGuild } = require('discord-info-lookup');
// or
import { getUser, getGuild } from 'discord-info-lookup';

const userInfo = await getUser('123456789012345678', yourToken);
const guildInfo = await getGuild('123456789012345678');

console.log(userInfo); // { id: 123456789012, username: "username", ...}
console.log(guildInfo); // { id: 123456789012, name: "guild name", ...}

Notes & Extras

  • The output of both functions are in JSON format for easier parsing and the output is cached for 1 hour to reduce API calls made to the Discord API. The cache is reset everytime your app starts because the node-cache package stores the cache in memory. There shouldn't be any performance implications unless you fetch bazillions (not tested) of user/guilds in a short period of time.

  • This package (only getUser()) checks token by either going through the process.env.TOKEN variable or the optional accessToken parameter. You can pass your token as a string into the accessToken parameter, for example: getUser('123456789012345678', 'token'). Not very safe, but it works.

  • If you by any chance inputted anything that is not a number into either getUser() or getGuild(), it will throw an error telling you that numbers were expected. It may be a bit of a problem, but I don't want to make it too complicated. Do make sure the input contains only number in a string format though.

  • I haven't tested the getGuild() function yet, but I'm sure it works. It also requires the server to be discoverable somewhat in order for it to actually work. Questions and suggestions are welcome.

  • This package is not meant to be used for malicious purposes. The purpose of this package is to make it easier to retrieve information about users and guilds. Whatever you do with the information is up to you and I am not liable for any issues that may or may not occur if you use this package for malicious purposes.

  • Please report any issues you encounter to GitHub. I will try my best to fix them as soon as possible.