Giter Site home page Giter Site logo

getsteamfolders's Introduction

getSteamFolders

Intro

This package helps finding all Steam folders, incase you want to look for game folders without any user input. Now dependency less!

Usage

Install the package using

npm i getsteamfolders

Import the needed function

import * as steamFolders from 'getsteamfolders'

Call getSteamMainLocation to get the primary location and getSteamLibraryLocations to get all locations.

API

getSteamMainLocation()

=> Promise<string | false>

Returns false if failed to resolve the path, otherwise returns the path of the main Steam installation path.

console.log(await steamFolders.getSteamMainLocation())
// -> C:\Program Files (x86)\Steam

getSteamLibraryLocations()

=> Promise<string[]>

Returns all used Steam installation paths.

console.log(await steamFolders.getSteamLibraryLocations())
/* -> [
  'C:\\Program Files (x86)\\Steam',
  'S:\\SteamLibrary',
  'U:\\SteamLibrary'
] */

getAllSteamGames()

=> Promise<Record<string, string>>

Get all installed Steam games. Name is key, path is the value.

console.log(await steamFolders.getAllSteamGames())

/* -> [
  Mordhau: 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\Mordhau',
  Noita: 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\Noita',
  Northgard: 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\Northgard',
  skyrim: 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\skyrim',
  ProjectZomboid: 'S:\\SteamLibrary\\steamapps\\common\\ProjectZomboid',
  ...
] */

getSteamGameLocation(searchName: string, contains? = false)

=> Promise<false | string>

Get the path of a specific game. If contains is set to true, it will lazily search for the game name in the list of all games. Search is always case insensitive and all spaces are removed.

console.log(await steamFolders.getSteamGameLocation('survivalists', true))

// -> U:\SteamLibrary\steamapps\common\The Survivalists

getsteamfolders's People

Stargazers

 avatar

Watchers

Kelpy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.