https://github.com/kelpycode/getsteamfolders
https://github.com/kelpycode/getsteamfolders
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kelpycode/getsteamfolders
- Owner: KelpyCode
- Created: 2023-02-22T16:52:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T00:51:42.000Z (over 3 years ago)
- Last Synced: 2025-02-18T20:45:09.522Z (over 1 year ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## 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
```js
import * as steamFolders from 'getsteamfolders'
```
Call `getSteamMainLocation` to get the primary location and `getSteamLibraryLocations` to get all locations.
# API
### `getSteamMainLocation()`
#### => ` Promise`
Returns `false` if failed to resolve the path, otherwise returns the path of the main Steam installation path.
```js
console.log(await steamFolders.getSteamMainLocation())
// -> C:\Program Files (x86)\Steam
```
### `getSteamLibraryLocations()`
#### => ` Promise`
Returns all used Steam installation paths.
```js
console.log(await steamFolders.getSteamLibraryLocations())
/* -> [
'C:\\Program Files (x86)\\Steam',
'S:\\SteamLibrary',
'U:\\SteamLibrary'
] */
```
### `getAllSteamGames()`
#### => ` Promise>`
Get all installed Steam games. Name is key, path is the value.
```js
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`
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.
```js
console.log(await steamFolders.getSteamGameLocation('survivalists', true))
// -> U:\SteamLibrary\steamapps\common\The Survivalists
```