New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

source-server-query

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-server-query

Query Source game servers using the Source Query Protocol.

Source
npmnpm
Version
2.0.4
Version published
Weekly downloads
70
-52.38%
Maintainers
1
Weekly downloads
 
Created
Source

Source Server Query

A library for querying Source servers using the Source Query Protocol. Execute A2S_INFO, A2S_PLAYER, and A2S_RULES server queries. Responses will be returned in an array or object depending on the request. All methods are asynchronous resulting in a clean and easy way to query many servers one by one should it be necessary.

Installing

You can add this module by running:

npm i source-server-query

and then use it:

const { info, players, rules, close } = require("source-server-query");

Usage

Each method: info, players, rules, uses the same arguments of an address and port. The port is the UDP query port, not the game port.

info("9.9.9.9", 27015, timeout).then(console.log);
players("9.9.9.9", 27015, timeout).then(console.log);
rules("9.9.9.9", 27015, timeout).then(console.log);

The methods are promise based, so the await keyword can be used aswell. You can also close the client at any time.

close();

For more information about each query request, as well as general source server information, see index.d.ts.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

Steam

FAQs

Package last updated on 28 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts