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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ssq

v0.0.1

Published

Source Server Queries for Node.JS

Downloads

38

Readme

node-ssq

A Node.JS library for sending Source Server Queries (SSQ) to source engine powered game servers (TF2, L4D, etc.).

I recommend glancing over the following Valve dev wiki page about SSQ:

https://developer.valvesoftware.com/wiki/Server_queries

WARNING

I created this library and shortly after didn't need it anymore. It should work fine, but has not been aggresively tested.

Known issue

Some long messages may be split into chunks or compressed. Neither of these modes are currently supported. If you see an error like:

SSQ response used unsupported split packet mode.

then you're out of luck. Currently I only get this message when requesting the rules list from some servers.

API

The API is very simple. All functions are passed a server string (dotted quad ipv4 address or domain name), a port number, and a callback function that takes an error as the first parameter and the returned data as the second parameter.

All the below examples assume this library is imported as ssq:

var ssq = require('node-ssq');

Ping

ssq.ping('1.23.45.67', 1337, function (err, data) {});

Pings the server. This message has been deprecated by Valve, and doesn't serve much of a use...

Server info

ssq.info('1.23.45.67', 1337, function (err, data) {});

Returns a single object with a lot of data about the server.

{ netver: 17,
  servername: 'Reddit Unofficial Gaming Community - East Coast',
  map: 'pl_upward',
  gamedirectory: 'tf',
  gamedescription: 'Team Fortress',
  appid: 440,
  numplayers: 23,
  maxplayers: 24,
  numbots: 0,
  servertype: 'd',
  os: 'l',
  password: 0,
  vacsecured: 1,
  gameversion: '1.2.1.0',
  EDF: 177,

  // The following properties are each individually optional
  port: 27015,
  steamID: <Buffer 02 e4 1e 81 af 0c 40 01>,
  sourceTV: { port: 27020, name: 'SourceTV' },
  keywords: '_registered,alltalk,east,nocrits,nodmgspread,payload,reddit,replays,rugc',
  gameID: <Buffer b8 01 00 00 00 00 00 00> }

Most of these values should be self explanatory.

The EDF value is a flag for the optional values. You shouldn't need to look at this flag yourself.

steamID and gameID are 64 bit values, so they are returned as node.js Buffer objects with 8 bytes. Note that all JavaScript numbers are 64-bit floating point numbers, with only 53 bits of precision, so 64 bit values should not be handled as primitive JavaScript numbers.

Players list

ssq.players('1.23.45.67', 1337, function (err, data) {});

Returns an array of players. Sample data:

[{ index: 0,
   name: 'Sample Name',
   score: 2,
   duration: 267.5876159667969 }, ...]

Note that the index attribute seems to always be 0, and the duration is in seconds.

Server rules

ssq.rules('1.23.45.67', 1337, function (err, data) {});

Returns an array of server rules. Sample data:

[{ name: 'sv_cheats', value: '1'}, ...]

Get challenge

ssq.get_challenge('1.23.45.67', 1337, function (err, data) {});

Queries the server for a challenge number, used by some of the requests. This method probably won't be needed by anybody, but is provided for completeness of the SSQ API.

<Buffer b8 a4 c3 0f>