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 🙏

© 2024 – Pkg Stats / Ryan Hefner

steam-path

v1.0.2

Published

Typescript library for fetching Steam paths independent of operating system.

Downloads

71

Readme

steam-path

Version Downloads License

steam-path is a module for locating the installation path of Steam and Steam apps.

Installation

You can install steam-path through the command line using npm or yarn.

npm install steam-path

Usage

import {
  getAppPath,
  getSteamPath,
  getLibraryFolders,
  getAppManifest,
} from "steam-path";

// or

import * as SteamPath from "steam-path";

Documentation

SteamPath.getAppPath(appId: number): Promise<AppPath>

Get a Steam app's path from app id

const BRAWLHALLA_APPID = 291550;

const path = await SteamPath.getAppPath(BRAWLHALLA_APPID);

> {
  name: "Brawlhalla",
  path: "/Users/<user>/Library/Application Support/Steam/steamapps/common/Brawlhalla"
};

SteamPath.getSteamPath(): Promise<SteamPath>

Get Steam's installation path as well as any app library paths

const path = await SteamPath.getSteamPath();

> {
  path: "/Users/<user>/Library/Application Support/Steam/",
  libs: [
    "/Users/<user>/Library/Application Support/Steam/steamapps/",
    "/Volumes/Drive01/SteamLibrary/"
  ]
};

getLibraryFolders(steamPath?: string): Promise<LibraryFolders>

Parse libraryfolders.vdf and return contents. If steamPath isn't provided it will attempt to find it.

const libary = await SteamPath.getLibraryFolders();

> {
  libraryfolders: {
    '0': {
      path: '<path>/Steam',
      label: '',
      contentid: 0123456789123456789,
      totalsize: 0,
      update_clean_bytes_tally: 01234567891,
      time_last_update_corruption: 0,
      apps: {
        "291550": "897667634"
      }
    },
    '1': {
      path: '/Volumes/Drive01/SteamLibrary',
      label: '',
      contentid: 0123456789123456789,
      totalsize: 0,
      update_clean_bytes_tally: 01234567891,
      time_last_update_corruption: 0,
      apps: {
        "570": "47537797371"
      }
    },
  }
}

getAppManifest(appId: number): Promise<AppManifest>

Get an app's manifest file.

const TROVE_APPID = 304050;

const manifest = await SteamPath.getAppManifest(TROVE_APPID);

> {
  AppState: {
    appid: 304050,
    Universe: 1,
    name: 'Trove',
    StateFlags: 4,
    installdir: 'Trove',
    LastUpdated: 1654701681,
    SizeOnDisk: 1621558789,
    StagingSize: 0,
    buildid: 8642809,
    LastOwner: 123456789,
    UpdateResult: 2,
    BytesToDownload: 934495216,
    BytesDownloaded: 934495216,
    BytesToStage: 1621558789,
    BytesStaged: 1621558789,
    TargetBuildID: 8642809,
    AutoUpdateBehavior: 0,
    AllowOtherDownloadsWhileRunning: 0,
    ScheduledAutoUpdate: 0,
    InstalledDepots: {
      '304052': { manifest: 8702402695142410000, size: 1505721654 },
      '845241': { manifest: 3390199620801870300, size: 115837135 }
    },
    InstallScripts: { '304052': 'installscript.vdf' },
    UserConfig: { language: 'english' },
    MountedConfig: { language: 'english' }
  },
  library_path: '/<path>/Steam/steamapps'
}

Contributing

Interested in contributing to steam-path?

Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests.

Help

Installing dependencies:

npm install

Compile:

npm run build

Tests

Due to its nature this project does not have any automated testing.

Any scripts used to user test functionality can be found in src/test.ts.

License

All code in this repository is licensed under MIT.