{"_id":"@caleb-collar/steamcmd","_rev":"3-0771f6607517b581dcde50b3a2fc0f41","name":"@caleb-collar/steamcmd","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0-alpha.1":{"name":"@caleb-collar/steamcmd","version":"1.0.0-alpha.1","keywords":["steam","steamcmd","valve","game-server","dedicated-server","workshop","download","install"],"author":{"name":"Björn Dahlgren"},"license":"MIT","_id":"@caleb-collar/steamcmd@1.0.0-alpha.1","maintainers":[{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"}],"homepage":"https://github.com/caleb-collar/node-steamcmd#readme","bugs":{"url":"https://github.com/caleb-collar/node-steamcmd/issues"},"bin":{"steamcmd":"bin/steamcmd"},"dist":{"shasum":"4a6cef211cbdf9e485456f5ce207f943999180d7","tarball":"https://registry.npmjs.org/@caleb-collar/steamcmd/-/steamcmd-1.0.0-alpha.1.tgz","fileCount":11,"integrity":"sha512-P8qkgYdDDJsaWf5aEPnmn/cN99bwfypDPrtv2stnBC7SOwB0JJJRC9vXHw6xeUsb3R/z0e9GkptiG6Wczmkm5g==","signatures":[{"sig":"MEUCIQCoPrRmxPaum+IbLrS1fDaI1kpgMv5T+BEqxGs6DYvezwIgPyLQKCE2V8vmvafCo3T9EOCe8/WB8GsrMJqwoR4VbtQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caleb-collar%2fsteamcmd@1.0.0-alpha.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":62663},"main":"src/steamcmd.js","types":"types/steamcmd.d.ts","module":"src/steamcmd.mjs","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./types/steamcmd.d.ts","default":"./src/steamcmd.mjs"},"require":{"types":"./types/steamcmd.d.ts","default":"./src/steamcmd.js"}}},"gitHead":"9156a87453a83e22deb9f5b1a9084e537d4ae8fd","scripts":{"lint":"standard --verbose **/*.js bin/*","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"},"repository":{"url":"git+https://github.com/caleb-collar/node-steamcmd.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js wrapper for SteamCMD - download, install, and manage Steam applications programmatically","directories":{},"_nodeVersion":"20.20.0","dependencies":{"tar":"^7.4.3","unzipper":"^0.12.3","commander":"^12.1.0","env-paths":"^2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","standard":"^17.1.2","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/steamcmd_1.0.0-alpha.1_1769916069502_0.7047387054943453","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@caleb-collar/steamcmd","version":"1.1.0","keywords":["steam","steamcmd","valve","game-server","dedicated-server","workshop","download","install"],"author":{"name":"Björn Dahlgren"},"license":"MIT","_id":"@caleb-collar/steamcmd@1.1.0","maintainers":[{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"}],"homepage":"https://github.com/caleb-collar/node-steamcmd#readme","bugs":{"url":"https://github.com/caleb-collar/node-steamcmd/issues"},"bin":{"steamcmd":"bin/steamcmd"},"dist":{"shasum":"d9817ab2521ce4eb7d5f6db5fe55c80380bea4fc","tarball":"https://registry.npmjs.org/@caleb-collar/steamcmd/-/steamcmd-1.1.0.tgz","fileCount":22,"integrity":"sha512-em+evo64lLw+W+NESqsTnv1EkbeaZt4j3GfaW+a8t8tso/RjCiQwufTzb+yjVMs+QRb9/uRbpzhEnX75FNkYVQ==","signatures":[{"sig":"MEUCIQDkyI5KTuRpAju2FeNduu+JKl2uYqfUWN/PmxWx47+nhwIgCSlfWkrmv7KliyPm1ACQviTLkeKdyuF5tuB8KvdHQi0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caleb-collar%2fsteamcmd@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":104893},"main":"dist/steamcmd.js","types":"dist/steamcmd.d.ts","module":"dist/steamcmd.mjs","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/steamcmd.d.ts","default":"./dist/steamcmd.mjs"},"require":{"types":"./dist/steamcmd.d.ts","default":"./dist/steamcmd.js"}}},"gitHead":"d1ce70cb1ab8db31f90e74c1a59119e9a693915e","scripts":{"docs":"typedoc --out docs src/steamcmd.ts","lint":"biome check .","test":"vitest run","build":"tsc && npm run build:esm-wrapper","clean":"rimraf dist docs","format":"biome format --write .","lint:fix":"biome check --write .","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run clean && npm run build","build:esm-wrapper":"node -e \"const fs=require('fs');fs.writeFileSync('dist/steamcmd.mjs',fs.readFileSync('src/steamcmd.mjs.template','utf8'))\""},"_npmUser":{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"},"repository":{"url":"git+https://github.com/caleb-collar/node-steamcmd.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js wrapper for SteamCMD - download, install, and manage Steam applications programmatically","directories":{},"_nodeVersion":"20.20.0","dependencies":{"tar":"^7.4.3","unzipper":"^0.12.3","commander":"^12.1.0","env-paths":"^2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.2","vitest":"^4.0.18","typedoc":"^0.28.16","typescript":"^5.9.3","@types/node":"^25.1.0","@biomejs/biome":"^2.3.13","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/steamcmd_1.1.0_1769922593302_0.699600379832354","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@caleb-collar/steamcmd","version":"1.1.1","description":"Node.js wrapper for SteamCMD - download, install, and manage Steam applications programmatically","main":"dist/steamcmd.js","module":"dist/steamcmd.mjs","types":"dist/steamcmd.d.ts","exports":{".":{"import":{"types":"./dist/steamcmd.d.ts","default":"./dist/steamcmd.mjs"},"require":{"types":"./dist/steamcmd.d.ts","default":"./dist/steamcmd.js"}}},"scripts":{"build":"tsc && npm run build:esm-wrapper","build:esm-wrapper":"node -e \"const fs=require('fs');fs.writeFileSync('dist/steamcmd.mjs',fs.readFileSync('src/steamcmd.mjs.template','utf8'))\"","clean":"rimraf dist docs","docs":"typedoc --out docs src/steamcmd.ts","prepublishOnly":"npm run clean && npm run build","lint":"biome check .","lint:fix":"biome check --write .","format":"biome format --write .","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},"bin":{"steamcmd":"bin/steamcmd"},"keywords":["steam","steamcmd","valve","game-server","dedicated-server","workshop","download","install"],"author":{"name":"Björn Dahlgren"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/caleb-collar/node-steamcmd.git"},"bugs":{"url":"https://github.com/caleb-collar/node-steamcmd/issues"},"homepage":"https://github.com/caleb-collar/node-steamcmd#readme","engines":{"node":">=18"},"dependencies":{"commander":"^12.1.0","env-paths":"^2.2.1","tar":"^7.4.3","unzipper":"^0.12.3"},"devDependencies":{"@biomejs/biome":"^2.3.13","@types/node":"^25.1.0","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^4.0.18","rimraf":"^6.1.2","typedoc":"^0.28.16","typescript":"^5.9.3","vitest":"^4.0.18"},"_id":"@caleb-collar/steamcmd@1.1.1","gitHead":"5075d445dab35f322285e42e5fe8e22b1bbd8f81","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AlqQB0vn3aZjHMtLoucJYLetIi+tQmsy0RIx4K6zHZRDnZwUs5Ao4ADo0NtzeWTXehEdrSvIcnuxiFmQ7lGLqg==","shasum":"f4e7b65fd46d178e229ccceda2d45c8a4a426b2d","tarball":"https://registry.npmjs.org/@caleb-collar/steamcmd/-/steamcmd-1.1.1.tgz","fileCount":22,"unpackedSize":105423,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caleb-collar%2fsteamcmd@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIATsG0YOvdfk220XGmBwnIxdpBbFtUjbIlpQMTGLrkNnAiEAwmlLc4aq37RoeYH0Eiw7tmokb9/Qd2+/OBuPCMNgRwY="}]},"_npmUser":{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"},"directories":{},"maintainers":[{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/steamcmd_1.1.1_1770089347914_0.23519566607239883"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-01T03:21:09.366Z","modified":"2026-02-03T03:29:08.386Z","1.0.0-alpha.1":"2026-02-01T03:21:09.670Z","1.1.0":"2026-02-01T05:09:53.470Z","1.1.1":"2026-02-03T03:29:08.079Z"},"bugs":{"url":"https://github.com/caleb-collar/node-steamcmd/issues"},"author":{"name":"Björn Dahlgren"},"license":"MIT","homepage":"https://github.com/caleb-collar/node-steamcmd#readme","keywords":["steam","steamcmd","valve","game-server","dedicated-server","workshop","download","install"],"repository":{"type":"git","url":"git+https://github.com/caleb-collar/node-steamcmd.git"},"description":"Node.js wrapper for SteamCMD - download, install, and manage Steam applications programmatically","maintainers":[{"name":"caleb-collar","email":"caleb.a.collar@gmail.com"}],"readme":"# SteamCMD\n\n[![CI](https://github.com/caleb-collar/node-steamcmd/actions/workflows/ci.yml/badge.svg)](https://github.com/caleb-collar/node-steamcmd/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/@caleb-collar/steamcmd.svg)](https://www.npmjs.com/package/@caleb-collar/steamcmd)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Node.js wrapper for Valve's [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD) tool. Download, install, and manage Steam applications programmatically.\n\n**Features:**\n\n- Automatic SteamCMD download and installation\n- Promise-based API with async/await support\n- Progress tracking for downloads and installations\n- TypeScript definitions included\n- Cross-platform (Windows, Linux, macOS)\n\nSteamCMD will be automatically downloaded to your platform-specific data folder:\n\n- **Linux:** `~/.local/share/steamcmd`\n- **macOS:** `~/Library/Application Support/steamcmd`\n- **Windows:** `%LOCALAPPDATA%\\steamcmd`\n\n## Requirements\n\n**Node.js 18 or higher** is required.\n\nSee [SteamCMD requirements](https://developer.valvesoftware.com/wiki/SteamCMD) for platform-specific dependencies.\n\nFor Ubuntu/Debian:\n\n```bash\nsudo apt-get install lib32gcc-s1\n```\n\n## Installation\n\n```bash\nnpm install @caleb-collar/steamcmd\n```\n\n## Usage\n\n### Module API (Recommended)\n\n#### Basic Installation\n\n```javascript\nconst steamcmd = require(\"@caleb-collar/steamcmd\");\n\n// Install a dedicated server (e.g., Counter-Strike 2)\nawait steamcmd.install({\n  applicationId: 730,\n  path: \"./cs2-server\",\n});\n```\n\n#### With Authentication\n\n```javascript\nawait steamcmd.install({\n  applicationId: 123456,\n  path: \"./game-server\",\n  username: \"your-steam-username\",\n  password: \"your-steam-password\",\n  steamGuardCode: \"12345\", // If Steam Guard is enabled\n});\n```\n\n#### Workshop Items\n\n```javascript\n// Download a workshop item\nawait steamcmd.install({\n  applicationId: 107410, // Arma 3\n  workshopId: 450814997,\n  path: \"./arma3\",\n});\n```\n\n#### Progress Tracking\n\n```javascript\nawait steamcmd.install({\n  applicationId: 740,\n  path: \"./csds\",\n  onProgress: (progress) => {\n    console.log(`${progress.phase}: ${progress.percent}%`);\n    // Output: \"downloading: 45%\", \"validating: 100%\"\n  },\n  onOutput: (data, type) => {\n    // type is 'stdout' or 'stderr'\n    process.stdout.write(data);\n  },\n});\n```\n\n#### Utility Functions\n\n```javascript\nconst steamcmd = require(\"@caleb-collar/steamcmd\");\n\n// Check if SteamCMD is installed\nconst installed = await steamcmd.isInstalled();\nconsole.log(\"SteamCMD installed:\", installed);\n\n// Get installation info\nconst info = steamcmd.getInfo();\nconsole.log(info);\n// {\n//   directory: '/home/user/.local/share/steamcmd',\n//   executable: '/home/user/.local/share/steamcmd/steamcmd.sh',\n//   platform: 'linux',\n//   isSupported: true\n// }\n\n// Manually ensure SteamCMD is installed\nawait steamcmd.ensureInstalled({\n  onProgress: (p) => console.log(`Download: ${p.percent}%`),\n});\n\n// List installed apps in a directory\nconst apps = await steamcmd.getInstalledApps({ path: \"./server\" });\nconsole.log(apps);\n// [{ appId: 740, name: 'CSGO Server', buildId: 12345, ... }]\n\n// Get installed version of an app\nconst version = await steamcmd.getInstalledVersion({\n  applicationId: 740,\n  path: \"./server\",\n});\nconsole.log(version);\n// { appId: 740, name: 'CSGO Server', buildId: 12345, lastUpdated: Date }\n\n// Update an existing installation\nawait steamcmd.update({\n  applicationId: 740,\n  path: \"./server\",\n  onProgress: (p) => console.log(`Update: ${p.percent}%`),\n});\n\n// Validate an installation\nawait steamcmd.validate({\n  applicationId: 740,\n  path: \"./server\",\n});\n```\n\n#### EventEmitter Progress\n\n```javascript\nconst steamcmd = require(\"@caleb-collar/steamcmd\");\n\n// Create an event emitter for real-time progress\nconst emitter = steamcmd.createProgressEmitter(\"install\", {\n  applicationId: 740,\n  path: \"./server\",\n});\n\nemitter.on(\"progress\", (p) => {\n  console.log(`${p.phase}: ${p.percent}%`);\n});\n\nemitter.on(\"output\", (data, type) => {\n  process.stdout.write(`[${type}] ${data}`);\n});\n\nemitter.on(\"error\", (err) => {\n  console.error(\"Failed:\", err.message);\n});\n\nemitter.on(\"complete\", () => {\n  console.log(\"Done!\");\n});\n```\n\n#### Error Handling\n\n```javascript\nconst {\n  SteamCmdError,\n  DownloadError,\n  InstallError,\n} = require(\"@caleb-collar/steamcmd\");\n\ntry {\n  await steamcmd.install({\n    applicationId: 740,\n    path: \"./server\",\n  });\n} catch (err) {\n  if (err instanceof SteamCmdError) {\n    console.error(`SteamCMD error: ${err.message} (code: ${err.code})`);\n  } else if (err instanceof InstallError) {\n    console.error(`Install failed: ${err.message}`);\n    console.error(`Exit code: ${err.exitCode}`);\n  } else {\n    throw err;\n  }\n}\n```\n\n#### Legacy Callback API\n\n```javascript\n// Callback-style is still supported for backward compatibility\nsteamcmd.install({ applicationId: 740, path: \"./server\" }, (err) => {\n  if (err) {\n    console.error(\"Installation failed:\", err.message);\n    return;\n  }\n  console.log(\"Installation complete!\");\n});\n```\n\n### API Reference\n\n#### `install(options, [callback])`\n\nInstall a Steam application or Workshop item.\n\n| Option           | Type               | Description                                           |\n| ---------------- | ------------------ | ----------------------------------------------------- |\n| `applicationId`  | `number \\| string` | Steam application ID to install                       |\n| `workshopId`     | `number \\| string` | Workshop item ID (requires `applicationId`)           |\n| `path`           | `string`           | Installation directory                                |\n| `username`       | `string`           | Steam username for authentication                     |\n| `password`       | `string`           | Steam password for authentication                     |\n| `steamGuardCode` | `string`           | Steam Guard code for 2FA                              |\n| `platform`       | `string`           | Target platform: `'windows'`, `'macos'`, or `'linux'` |\n| `onProgress`     | `function`         | Progress callback: `(progress) => void`               |\n| `onOutput`       | `function`         | Output callback: `(data, type) => void`               |\n\n**Returns:** `Promise<void>` if no callback provided, `undefined` if callback provided.\n\n#### `isInstalled()`\n\nCheck if SteamCMD is installed and executable.\n\n**Returns:** `Promise<boolean>`\n\n#### `ensureInstalled([options])`\n\nEnsure SteamCMD is installed, downloading if necessary.\n\n| Option       | Type       | Description                |\n| ------------ | ---------- | -------------------------- |\n| `onProgress` | `function` | Download progress callback |\n\n**Returns:** `Promise<void>`\n\n#### `getInfo()`\n\nGet information about the SteamCMD installation.\n\n**Returns:** `{ directory, executable, platform, isSupported }`\n\n#### `getInstalledApps(options)`\n\nList all installed Steam applications in a directory.\n\n| Option | Type     | Description                    |\n| ------ | -------- | ------------------------------ |\n| `path` | `string` | Installation directory to scan |\n\n**Returns:** `Promise<Array>` - Array of installed app info objects\n\n#### `getInstalledVersion(options)`\n\nGet the installed version of a Steam application.\n\n| Option          | Type               | Description            |\n| --------------- | ------------------ | ---------------------- |\n| `applicationId` | `number \\| string` | Steam application ID   |\n| `path`          | `string`           | Installation directory |\n\n**Returns:** `Promise<Object | null>` - Version info or null if not installed\n\n#### `update(options)`\n\nUpdate an installed Steam application.\n\n| Option           | Type               | Description                    |\n| ---------------- | ------------------ | ------------------------------ |\n| `applicationId`  | `number \\| string` | Steam application ID to update |\n| `path`           | `string`           | Installation directory         |\n| `username`       | `string`           | Steam username (optional)      |\n| `password`       | `string`           | Steam password (optional)      |\n| `steamGuardCode` | `string`           | Steam Guard code (optional)    |\n| `onProgress`     | `function`         | Progress callback (optional)   |\n\n**Returns:** `Promise<void>`\n\n#### `validate(options)`\n\nValidate an installed Steam application.\n\n| Option          | Type               | Description                      |\n| --------------- | ------------------ | -------------------------------- |\n| `applicationId` | `number \\| string` | Steam application ID to validate |\n| `path`          | `string`           | Installation directory           |\n| `username`      | `string`           | Steam username (optional)        |\n| `password`      | `string`           | Steam password (optional)        |\n| `onProgress`    | `function`         | Progress callback (optional)     |\n\n**Returns:** `Promise<void>`\n\n#### `createProgressEmitter(operation, options)`\n\nCreate an EventEmitter for real-time progress tracking.\n\n| Parameter   | Type     | Description                                           |\n| ----------- | -------- | ----------------------------------------------------- |\n| `operation` | `string` | Operation type: `'install'`, `'update'`, `'validate'` |\n| `options`   | `object` | Same options as `install()`                           |\n\n**Returns:** `EventEmitter` - Emits `'progress'`, `'output'`, `'error'`, and `'complete'` events\n\n### Command Line Interface\n\n```bash\nnpx steamcmd <appid> [workshopid] [options]\n```\n\n**Options:**\n\n| Option                     | Description                               |\n| -------------------------- | ----------------------------------------- |\n| `-u, --username <value>`   | Steam username                            |\n| `-p, --password <value>`   | Steam password                            |\n| `--path <value>`           | Install path (default: current directory) |\n| `--platform <value>`       | Target platform                           |\n| `--steamGuardCode <value>` | Steam Guard code                          |\n| `-h, --help`               | Show help                                 |\n\n**Examples:**\n\n```bash\n# Install CS2 dedicated server\nnpx steamcmd 730 --path ./cs2-server\n\n# Install with authentication\nnpx steamcmd 123456 --username myuser --password mypass --path ./game\n\n# Install a workshop item\nnpx steamcmd 107410 450814997 --path ./arma3\n```\n\n## TypeScript\n\nTypeScript definitions are included:\n\n```typescript\nimport steamcmd, {\n  SteamCmdError,\n  InstallOptions,\n} from \"@caleb-collar/steamcmd\";\n\nconst options: InstallOptions = {\n  applicationId: 740,\n  path: \"./server\",\n  onProgress: (progress) => {\n    console.log(`${progress.phase}: ${progress.percent}%`);\n  },\n};\n\nawait steamcmd.install(options);\n```\n\n## ES Modules\n\nThe package supports both CommonJS and ES Modules:\n\n```javascript\n// CommonJS\nconst steamcmd = require(\"@caleb-collar/steamcmd\");\n\n// ES Modules\nimport steamcmd from \"@caleb-collar/steamcmd\";\n// or with named exports\nimport { install, getInfo, SteamCmdError } from \"@caleb-collar/steamcmd\";\n```\n\n## Finding App IDs\n\n- [Steam Application IDs](https://developer.valvesoftware.com/wiki/Steam_Application_IDs)\n- [SteamDB](https://steamdb.info/)\n\nWorkshop IDs can be found in the URL of any Workshop item page.\n\n## License\n\nMIT\n\n## Credits\n\n- **Original Author:** [Björn Dahlgren](https://github.com/dahlgren) - Creator of the original node-steamcmd package\n- **Modernization:** [Caleb Collar](https://github.com/caleb-collar) - ES Modules, TypeScript definitions, Promise API, and modern Node.js support\n","readmeFilename":"README.md"}