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

node-steamid-resolver-ts

v2.0.8

Published

Professional TypeScript library for Steam ID resolution with comprehensive error handling

Readme

node-steamid-resolver-ts

Professional TypeScript library for Steam ID resolution with comprehensive error handling and type safety.

Features

  • Type-Safe: Complete TypeScript support with precise interfaces
  • Robust: Handles all Steam XML response variations (public/private profiles, groups, errors)
  • Flexible: Dual Promise/callback support
  • Fast: Built with Bun, optimized for performance
  • Well-Tested: 100% test coverage with real Steam data

Installation

bun add node-steamid-resolver-ts
npm install node-steamid-resolver-ts

Quick Start

import {
  customUrlToSteamID64,
  steamID64ToCustomUrl,
  steamID64ToFullInfo,
  SteamProfileNotFoundError,
} from "node-steamid-resolver-ts";

// Basic conversions
const customUrl = await steamID64ToCustomUrl("76561198260031749"); // "3urobeat"
const steamId = await customUrlToSteamID64("3urobeat"); // "76561198260031749"

console.log("Custom URL:", customUrl);
console.log("Steam ID:", steamId);

// Full profile data
const profile = await steamID64ToFullInfo("76561198260031749");
console.log("Profile data:", profile.steamID[0], profile.memberSince?.[0]);

// Error handling
try {
  await steamID64ToCustomUrl("86561198260031749");
} catch (error) {
  if (error instanceof SteamProfileNotFoundError) {
    console.log("(Error) Profile not found");
  }
}

// Callback support
steamID64ToCustomUrl("76561198260031749", (err, result) => {
  if (!err) console.log("(Callback) Custom URL:", result);
});

API Reference

Profile Functions

| Function | Description | Returns | | ---------------------------------------- | ------------------------- | ----------------- | | steamID64ToCustomUrl(id, callback?) | Steam ID64 → custom URL | string \| null | | steamID64ToProfileName(id, callback?) | Steam ID64 → display name | string | | customUrlToSteamID64(url, callback?) | Custom URL → Steam ID64 | string | | customUrlToProfileName(url, callback?) | Custom URL → display name | string | | steamID64ToFullInfo(id, callback?) | Steam ID64 → full profile | FullProfileInfo | | customUrlToFullInfo(url, callback?) | Custom URL → full profile | FullProfileInfo |

Group Functions

| Function | Description | Returns | | ------------------------------------- | --------------------------- | --------------- | | groupUrlToGroupID64(url, callback?) | Group URL → group ID64 | string | | groupUrlToFullInfo(url, callback?) | Group URL → full group info | FullGroupInfo |

Utilities

| Function | Description | Returns | | ------------------------------------ | ----------------------------- | --------- | | isValidSharedfileID(id, callback?) | Validate sharedfile existence | boolean |

TypeScript Support

Complete type definitions for all response formats:

import type { FullProfileInfo, FullGroupInfo } from "node-steamid-resolver-ts";

const profile: FullProfileInfo = await steamID64ToFullInfo("76561198260031749");

// Properly typed optional fields
const customUrl: string | undefined = profile.customURL?.[0];
const avatarUrl: string | undefined = profile.avatarFull?.[0];
const memberSince: string | undefined = profile.memberSince?.[0];

Error Handling

Specific error classes for different failure scenarios:

import {
  SteamAPIError, // Base error class
  SteamProfileNotFoundError, // Profile doesn't exist
  SteamGroupNotFoundError, // Group doesn't exist
  SteamPrivateProfileError, // Profile is private
  SteamEmptyResponseError, // Steam returned empty response
} from "node-steamid-resolver-ts";

Response Variations

Handles all Steam XML response types based on real-world analysis:

  • Public Profiles: Full data including avatars, games, groups
  • Private Profiles: Minimal data (ID, privacy state, custom URL)
  • Limited Accounts: Basic public info only
  • Invalid Profiles: Empty responses, proper error handling
  • Groups: Member lists, group details, error pages

Development

# Install dependencies
bun install

# Run tests (100% coverage)
bun test

# Build for production
bun run build

# Lint and format
bun format && bun lint

Migration from JS Version

Drop-in replacement for the original JavaScript library:

- const resolver = require('steamid-resolver')
- resolver.steamID64ToCustomUrl('76561198260031749', callback)
+ import { steamID64ToCustomUrl } from 'node-steamid-resolver-ts'
+ steamID64ToCustomUrl('76561198260031749', callback)

All function signatures remain identical for seamless migration.

License

MIT © Original library by 3urobeat

Converted to TypeScript with enhanced error handling, type safety, and comprehensive test coverage.