gamelibio
v0.0.3
Published
Async TypeScript APIs for local Steam library data.
Readme
gamelibio
Async TypeScript APIs for local Steam library data.
Steam APIs are exported from gamelibio/steam.
Docs
bun installUsage
import { SteamClient, readCollections } from "gamelibio/steam";
const rootPath = "/home/deck/.local/share/Steam";
const userId = "123456789";
const steam = new SteamClient({ rootPath, userId });
// Or discover a Steam root automatically:
const discoveredSteam = await SteamClient.discover({ userId });
const [folders, apps, collections] = await Promise.all([
steam.libraryFolders(),
steam.installedApps(),
steam.collections.list(),
]);
const shortcuts = await steam.shortcuts.list();
const cacheEntries = await steam.libraryCache.list();
const artwork = await steam.artwork.list();
const screenshots = await steam.media.screenshots();
const recordings = await steam.media.recordings();
const sameCollections = await readCollections(rootPath, userId);
console.log({
folders: folders.length,
apps: apps.length,
collections: collections.length,
shortcuts: shortcuts.length,
cacheEntries: cacheEntries.length,
artwork: artwork.length,
screenshots: screenshots.length,
recordings: recordings.length,
sameCollections: sameCollections.length,
});Collection changes write immediately:
await steam.collections.create({ name: "Co-op", appIds: [111111] });
await steam.collections.addApps("uc-co-op", [222222]);Use batch to make several changes with one write:
await steam.collections.batch((collections) => {
collections.create({ name: "Co-op", appIds: [111111] });
collections.addApps("uc-co-op", [222222]);
collections.rename("uc-co-op", "Local co-op");
});Preview changes without writing:
const preview = await steam.collections.preview((collections) => {
collections.create({ name: "Co-op", appIds: [111111] });
});
const diff = await steam.collections.diff((collections) => {
collections.addApps("from-tag-Favorites", [222222]);
});