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

gamestate

v0.5.0

Published

Universal game server status and player query tool

Readme

🎮 gamestate — Universal Game Server Status Query Tool

npm version npm downloads node-current license PRs welcome Open Source Love

gamestate is a modern game server querying CLI & API for 40+ game types:

  • Minecraft — Java (with SRV record support) & Bedrock
  • Source engine (A2S) — CS2, CS:GO, CS:S, TF2, Garry's Mod, Left 4 Dead 2, Rust, ARK, Valheim, Squad, 7 Days to Die, Unturned, Project Zomboid, DayZ, Arma 3, Conan Exiles, Palworld, Insurgency, Mordhau, …
  • FiveM / RedM — GTA V multiplayer (HTTP)
  • Quake3 getstatus — Call of Duty (2/4/MW), Quake 3, Quake Live, OpenArena, Xonotic, Warsow, ET: Legacy
  • Multi Theft Auto: San Andreas (MTA:SA)

Run gamestate --list for the full list of aliases.

Works everywhere — even if UDP ports are blocked ✔
Automatic SRV resolution for Minecraft Java ✔
Reliable Steam API fallback for CS2 ✔
Clean and compact server info ✔


📦 Install

Global CLI:

npm install -g gamestate
npm install gamestate

🖥️ CLI Usage

gamestate <game_type> <ip[:port]>

Examples:

gamestate minecraft mc.hypixel.net
gamestate bedrock play.nethergames.org
gamestate cs2 51.210.246.171:27015
gamestate rust 1.2.3.4:28015
gamestate fivem 1.2.3.4:30120
gamestate cod4 1.2.3.4:28960
gamestate mta 91.200.42.46:22003
gamestate --list          # show every supported game type

If you omit the port, a sensible default is used per game (e.g. 27015 for CS2, 28015 for Rust, 30120 for FiveM, 25565 for Minecraft). Minecraft Java also resolves _minecraft._tcp SRV records automatically.

🧩 Node.js API Usage

import { query, supportedGames } from "gamestate";

const status = await query({
  type: "minecraft",
  host: "mc.hypixel.net"
  // port is optional
});

console.log(status);
console.log(supportedGames()); // -> ["7dtd", "ark", "arma3", ...]

🔑 Optional: Steam API Key (CS2 fallback)

CS2 servers are queried natively over UDP (A2S). When UDP is blocked or the server does not answer, gamestate can fall back to the Steam Web API if you provide a key. Copy .env.example to .env and set your key:

STEAM_API_KEY=your_key_here

Get a free key at https://steamcommunity.com/dev/apikey. Without a key, CS2 queries still work over UDP; only the blocked-UDP fallback is disabled.

📊 Returned Data Fields by Game Type

| Field | Minecraft Java | Minecraft Bedrock | CS2 | MTA:SA | Notes | |------|:---:|:---:|:---:|:---:|------| | name | ✔ | ✔ | ✔ | ✔ | Server name | | numplayers | ✔ | ✔ | ✔ | ✔ | Active players | | maxplayers | ✔ | ✔ | ✔ | ✔ | CS2 via A2S; Steam API used only if UDP is blocked | | version | ✔ | ✔ | ✔ | ✔ | Game version | | map | ❌ | ❌ | ✔ | ❌ | Only CS2 (A2S) reports the map | | ping | ✔ | ✔ | ✔* | ❌ | *N/A when the Steam API fallback is used | | gamemode | ❌ | ✔ | ❌ | ❌ | Bedrock only | | players[] list | ✔ | ❌ | ❌ | ❌ | Minecraft Java sample (subset the server exposes) | | protocol | ✔ | ✔ | ✔ | ✔ | Source of query | | raw | ✔ | ✔ | ✔ | ✔ | Full response data |