Registry / communication / gamedig

gamedig

JSON →
library0.9.0jsnpmunverified

GameDig is a robust Node.js library engineered for querying the status of a vast array of game and voice servers. The current stable version, 5.3.2, offers an extensive solution for developers needing to fetch public status information from over 320 different game titles and services, along with general protocols. The library is actively maintained, with updates and breaking changes between major versions (e.g., v4 to v5) well-documented in `MIGRATE_IDS.md` and `CHANGELOG.md`. Its key differentiators include broad game support, a straightforward API compatible with both CommonJS and ESM environments, and its dual functionality as a command-line executable. It's a reliable choice for integrating game server status monitoring into applications, supported by an active community on Discord and GitHub.

npm install gamedig
INSTALL
IMPORT
SIG · GAMEDIG
G
gamedig
communicationjavascriptv0.9.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GameDig
import { GameDig } from 'gamedig';
import GameDig from 'gamedig';
GameDig is a named export, not a default export. Incorrectly using a default import will result in `undefined` or runtime errors.
GameDig (CommonJS)
const { GameDig } = require('gamedig');
const GameDig = require('gamedig');
For CommonJS, `GameDig` is a named property on the module export. Direct require without destructuring will return the module object.
GameDig Query Method
GameDig.query({ type: 'game', host: 'ip' });
new GameDig().query(...);
The `query` method is static and called directly on the `GameDig` export, not on an instance. While `new GameDig()` might technically work depending on internal implementation, it's not the intended or documented pattern.

Demonstrates how to query the status of a game server (e.g., Minecraft, CS:GO) using GameDig's static `query` method, including success and error handling.

import { GameDig } from 'gamedig'; // Example: Query a Minecraft server GameDig.query({ type: 'minecraft', host: 'mc.hypixel.net' }).then((state) => { console.log('Server Status:', state); // Example of accessing state data console.log(`Players online: ${state.players.length}/${state.maxplayers}`); console.log(`Map: ${state.map}`); }).catch((error) => { console.log(`Server is offline or unreachable, error: ${error.message || error}`); }); // Example: Query a different game (e.g., Counter-Strike: Global Offensive) GameDig.query({ type: 'csgo', host: '192.168.1.100', // Replace with an actual CS:GO server IP/hostname port: 27015 // Default query port for CS:GO, often the game port }).then((state) => { console.log('CS:GO Server Status:', state); }).catch((error) => { console.log(`CS:GO server query failed: ${error.message || error}`); });
gamedig --version
Debug
Known issues
breakingA significant breaking change occurred between v4 and v5, primarily affecting game IDs. Many game identifiers were renamed or consolidated.
fix
Consult the `MIGRATE_IDS.md` document in the repository to update game IDs in your application. Also, review the `CHANGELOG.md` for other API adjustments.
affects: >=5.0.0
gotchaSome game types require additional specific parameters beyond just `type` and `host` for successful querying, or might use a non-standard query port.
fix
Always refer to the `GAMES_LIST.md` file for details on required fields and notes specific to each game. If a query fails, try explicitly setting the `port` option.
affects: >=4.0.0
gotchaUsing a server's game port instead of its dedicated query port can lead to failed queries for certain protocols or games.
fix
If queries aren't working as expected, attempt to specify the server's dedicated query port (if known and different from the game port) using the `port` option in the query configuration.
affects: >=4.0.0
gotchaThe `host` field will be resolved via DNS by default. If you need to connect to a specific IP address without DNS resolution, you must use the `address` option.
fix
To bypass DNS resolution and connect directly to an IP, use `address: '192.168.1.1'` instead of or in conjunction with `host` (as some protocols still use `host` for other reasons).
affects: >=4.0.0
Errors
Common errors & fixes
Server is offline, error: Timeout
The game server is either genuinely offline, unreachable due to network issues (e.g., firewall), or the specified host/port is incorrect.
fix
Verify the server's status and network connectivity. Double-check the `host` and `port` parameters for correctness. Ensure no firewalls are blocking the outbound connection.
Game type 'old_game_id' not found.
Attempting to query a game using an outdated or incorrect game ID, often encountered during migration from GameDig v4 to v5.
fix
Consult the `MIGRATE_IDS.md` and `GAMES_LIST.md` files to find the current and correct game identifier for the server you are trying to query.
Error: Protocol not found: unknown-protocol
The `type` field in the query options specified an unrecognized game ID or an unsupported direct protocol name.
fix
Ensure the `type` field corresponds to a valid game ID from `GAMES_LIST.md` or a supported `protocol-[name]` as defined in the library's `protocols/index.js`.
Upgrade
Version history
0.9.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
gamedig — npm install gamedig · libregistry