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

@caleb-collar/steamcmd

v1.1.1

Published

Node.js wrapper for SteamCMD - download, install, and manage Steam applications programmatically

Readme

SteamCMD

CI npm version License: MIT

A Node.js wrapper for Valve's SteamCMD tool. Download, install, and manage Steam applications programmatically.

Features:

  • Automatic SteamCMD download and installation
  • Promise-based API with async/await support
  • Progress tracking for downloads and installations
  • TypeScript definitions included
  • Cross-platform (Windows, Linux, macOS)

SteamCMD will be automatically downloaded to your platform-specific data folder:

  • Linux: ~/.local/share/steamcmd
  • macOS: ~/Library/Application Support/steamcmd
  • Windows: %LOCALAPPDATA%\steamcmd

Requirements

Node.js 18 or higher is required.

See SteamCMD requirements for platform-specific dependencies.

For Ubuntu/Debian:

sudo apt-get install lib32gcc-s1

Installation

npm install @caleb-collar/steamcmd

Usage

Module API (Recommended)

Basic Installation

const steamcmd = require("@caleb-collar/steamcmd");

// Install a dedicated server (e.g., Counter-Strike 2)
await steamcmd.install({
  applicationId: 730,
  path: "./cs2-server",
});

With Authentication

await steamcmd.install({
  applicationId: 123456,
  path: "./game-server",
  username: "your-steam-username",
  password: "your-steam-password",
  steamGuardCode: "12345", // If Steam Guard is enabled
});

Workshop Items

// Download a workshop item
await steamcmd.install({
  applicationId: 107410, // Arma 3
  workshopId: 450814997,
  path: "./arma3",
});

Progress Tracking

await steamcmd.install({
  applicationId: 740,
  path: "./csds",
  onProgress: (progress) => {
    console.log(`${progress.phase}: ${progress.percent}%`);
    // Output: "downloading: 45%", "validating: 100%"
  },
  onOutput: (data, type) => {
    // type is 'stdout' or 'stderr'
    process.stdout.write(data);
  },
});

Utility Functions

const steamcmd = require("@caleb-collar/steamcmd");

// Check if SteamCMD is installed
const installed = await steamcmd.isInstalled();
console.log("SteamCMD installed:", installed);

// Get installation info
const info = steamcmd.getInfo();
console.log(info);
// {
//   directory: '/home/user/.local/share/steamcmd',
//   executable: '/home/user/.local/share/steamcmd/steamcmd.sh',
//   platform: 'linux',
//   isSupported: true
// }

// Manually ensure SteamCMD is installed
await steamcmd.ensureInstalled({
  onProgress: (p) => console.log(`Download: ${p.percent}%`),
});

// List installed apps in a directory
const apps = await steamcmd.getInstalledApps({ path: "./server" });
console.log(apps);
// [{ appId: 740, name: 'CSGO Server', buildId: 12345, ... }]

// Get installed version of an app
const version = await steamcmd.getInstalledVersion({
  applicationId: 740,
  path: "./server",
});
console.log(version);
// { appId: 740, name: 'CSGO Server', buildId: 12345, lastUpdated: Date }

// Update an existing installation
await steamcmd.update({
  applicationId: 740,
  path: "./server",
  onProgress: (p) => console.log(`Update: ${p.percent}%`),
});

// Validate an installation
await steamcmd.validate({
  applicationId: 740,
  path: "./server",
});

EventEmitter Progress

const steamcmd = require("@caleb-collar/steamcmd");

// Create an event emitter for real-time progress
const emitter = steamcmd.createProgressEmitter("install", {
  applicationId: 740,
  path: "./server",
});

emitter.on("progress", (p) => {
  console.log(`${p.phase}: ${p.percent}%`);
});

emitter.on("output", (data, type) => {
  process.stdout.write(`[${type}] ${data}`);
});

emitter.on("error", (err) => {
  console.error("Failed:", err.message);
});

emitter.on("complete", () => {
  console.log("Done!");
});

Error Handling

const {
  SteamCmdError,
  DownloadError,
  InstallError,
} = require("@caleb-collar/steamcmd");

try {
  await steamcmd.install({
    applicationId: 740,
    path: "./server",
  });
} catch (err) {
  if (err instanceof SteamCmdError) {
    console.error(`SteamCMD error: ${err.message} (code: ${err.code})`);
  } else if (err instanceof InstallError) {
    console.error(`Install failed: ${err.message}`);
    console.error(`Exit code: ${err.exitCode}`);
  } else {
    throw err;
  }
}

Legacy Callback API

// Callback-style is still supported for backward compatibility
steamcmd.install({ applicationId: 740, path: "./server" }, (err) => {
  if (err) {
    console.error("Installation failed:", err.message);
    return;
  }
  console.log("Installation complete!");
});

API Reference

install(options, [callback])

Install a Steam application or Workshop item.

| Option | Type | Description | | ---------------- | ------------------ | ----------------------------------------------------- | | applicationId | number \| string | Steam application ID to install | | workshopId | number \| string | Workshop item ID (requires applicationId) | | path | string | Installation directory | | username | string | Steam username for authentication | | password | string | Steam password for authentication | | steamGuardCode | string | Steam Guard code for 2FA | | platform | string | Target platform: 'windows', 'macos', or 'linux' | | onProgress | function | Progress callback: (progress) => void | | onOutput | function | Output callback: (data, type) => void |

Returns: Promise<void> if no callback provided, undefined if callback provided.

isInstalled()

Check if SteamCMD is installed and executable.

Returns: Promise<boolean>

ensureInstalled([options])

Ensure SteamCMD is installed, downloading if necessary.

| Option | Type | Description | | ------------ | ---------- | -------------------------- | | onProgress | function | Download progress callback |

Returns: Promise<void>

getInfo()

Get information about the SteamCMD installation.

Returns: { directory, executable, platform, isSupported }

getInstalledApps(options)

List all installed Steam applications in a directory.

| Option | Type | Description | | ------ | -------- | ------------------------------ | | path | string | Installation directory to scan |

Returns: Promise<Array> - Array of installed app info objects

getInstalledVersion(options)

Get the installed version of a Steam application.

| Option | Type | Description | | --------------- | ------------------ | ---------------------- | | applicationId | number \| string | Steam application ID | | path | string | Installation directory |

Returns: Promise<Object | null> - Version info or null if not installed

update(options)

Update an installed Steam application.

| Option | Type | Description | | ---------------- | ------------------ | ------------------------------ | | applicationId | number \| string | Steam application ID to update | | path | string | Installation directory | | username | string | Steam username (optional) | | password | string | Steam password (optional) | | steamGuardCode | string | Steam Guard code (optional) | | onProgress | function | Progress callback (optional) |

Returns: Promise<void>

validate(options)

Validate an installed Steam application.

| Option | Type | Description | | --------------- | ------------------ | -------------------------------- | | applicationId | number \| string | Steam application ID to validate | | path | string | Installation directory | | username | string | Steam username (optional) | | password | string | Steam password (optional) | | onProgress | function | Progress callback (optional) |

Returns: Promise<void>

createProgressEmitter(operation, options)

Create an EventEmitter for real-time progress tracking.

| Parameter | Type | Description | | ----------- | -------- | ----------------------------------------------------- | | operation | string | Operation type: 'install', 'update', 'validate' | | options | object | Same options as install() |

Returns: EventEmitter - Emits 'progress', 'output', 'error', and 'complete' events

Command Line Interface

npx steamcmd <appid> [workshopid] [options]

Options:

| Option | Description | | -------------------------- | ----------------------------------------- | | -u, --username <value> | Steam username | | -p, --password <value> | Steam password | | --path <value> | Install path (default: current directory) | | --platform <value> | Target platform | | --steamGuardCode <value> | Steam Guard code | | -h, --help | Show help |

Examples:

# Install CS2 dedicated server
npx steamcmd 730 --path ./cs2-server

# Install with authentication
npx steamcmd 123456 --username myuser --password mypass --path ./game

# Install a workshop item
npx steamcmd 107410 450814997 --path ./arma3

TypeScript

TypeScript definitions are included:

import steamcmd, {
  SteamCmdError,
  InstallOptions,
} from "@caleb-collar/steamcmd";

const options: InstallOptions = {
  applicationId: 740,
  path: "./server",
  onProgress: (progress) => {
    console.log(`${progress.phase}: ${progress.percent}%`);
  },
};

await steamcmd.install(options);

ES Modules

The package supports both CommonJS and ES Modules:

// CommonJS
const steamcmd = require("@caleb-collar/steamcmd");

// ES Modules
import steamcmd from "@caleb-collar/steamcmd";
// or with named exports
import { install, getInfo, SteamCmdError } from "@caleb-collar/steamcmd";

Finding App IDs

Workshop IDs can be found in the URL of any Workshop item page.

License

MIT

Credits

  • Original Author: Björn Dahlgren - Creator of the original node-steamcmd package
  • Modernization: Caleb Collar - ES Modules, TypeScript definitions, Promise API, and modern Node.js support