JSPM

@ciberus/find-steam-app

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q51732F
  • License MIT

Find location of an installed Steam app

Package Exports

  • @ciberus/find-steam-app
  • @ciberus/find-steam-app/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ciberus/find-steam-app) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ciberus/find-steam-app

Find location of an installed Steam app

Install

npm i @ciberus/find-steam-app -S

Steam has "Libraries" - locations on disks there games installed Steam "Libraries" has 2 versions, most users use v2, but this package support v1 also

  • v1 - contain only path to library, we can identify where app installed only indirectly by searching apps manifests appmanifest_%appId%.acf in Steam Libraries
  • v2 - contains complete info about library and apps inside it, that gives opportunity to detect where app installed exactly

Support

  • windows ✅
  • osx - ✅
  • linux - ⚠️not tested

Usage

import {
  ISteamLibraries,
  IAppManifest,
  ISteamLibrariesRaw,
  findSteamPath,
  findSteamAppById,
  findSteamAppByName,
  findSteamAppManifest,
  findSteamLibraries,
  getLibraryAppsManifestsFolder,
  getLibraryAppsInstallFolder,
} from "find-steam-app";

await findSteamPath();
// => '/path/to/steam'

await findSteamAppById(570);
// => '/path/to/steam/steamapps/common/dota 2 beta'

await findSteamAppByName("dota 2 beta");
// => '/path/to/steam/steamapps/common/dota 2 beta'

const res: IAppManifest = await findSteamAppManifest(570);
// => { appid: 570, Universe: 1, name: 'Dota 2', ... }
// returns `AppManifest` more info below

const libs = await findSteamLibrariesPaths();
// => ['/path/to/steam', '/path/to/library']

// can be transformed like this
libs.map(getLibraryAppsManifestsFolder);
// => ['/path/to/steam/steamapps', '/path/to/library/steamapps']
libs.map(getLibraryAppsInstallFolder);
// => ['/path/to/steam/steamapps/common', '/path/to/library/steamapps/common']

const steamLibsRaw: ISteamLibrariesRaw = await findSteamLibraries();
// => [{ path: '/path/to/library/steamapps', totalsize: 41234, apps: ['570'], ... }, ...]

const steamLibs: ISteamLibraries = await findSteam();
// => {
//      version: "v2",
//      libraries: [{
//           path: "/path/to/lib",
//           apps: [{
//             appId: 570,
//             path: "/path/to/app",
//             manifest: {
//                appid: 570,
//                installdir: "dota 2 beta"
//                buildid: 340918349
//                ...
//             }
//          }]
//      }]
//    }

AppManifest - manifest.ts

Tests

  • __data__ contain the files that will be used to mock the filesystem.
  • __data__ mimic the filesystem of the computer.
  • so if u know any edge cases, u can try to add those files and see if it works

Edge cases

  1. after uninstall app folder like "dota 2 beta" in "common" still exist
  2. after moving app folder in another library manifest still exists in old library but became encrypted and *.acf.tmp.save manifest created near
  3. dota 2 was installed on disk D, moved on disk F, and somehow in library on disk E in /common folder dota 2 beta folder exist
  • disk D

    • has appmanifest_570.acf
    • has appmanifest_570.acf.tmp.save
    • no folder dota 2 beta in /common
  • disk E

    • no manifest
    • has folder dota 2 beta in /common
  • disk F - right disk

    • has appmanifest_570.acf
    • dont have appmanifest *.acf.tmp.save
    • has folder dota 2 beta in /common

TODO

  • jsdoc/tsdoc