UNPKG

steamgames

Version:

A package for fetching game data from Steam APIs

13 lines (12 loc) 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSteamIDforGame = getSteamIDforGame; // import { loadCachedAppList } from "../utils/loadSteamIds"; const getSteamIDList_1 = require("./getSteamIDList"); async function getSteamIDforGame(gameName) { const appList = await (0, getSteamIDList_1.getSteamIDList)(); const appMap = appList.applist.apps.app; // Find the first game whose name contains the search string (case-insensitive) const match = appMap.find((app) => app.name.toLowerCase().includes(gameName.toLowerCase())); return match?.appid; }