-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
35 lines (30 loc) · 1.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Description: This project is a collection of utilities that can be used to find Steam App IDs from a variety of sources.
// Suppresses the warning about the fetch API being unstable
process.removeAllListeners('warning');
import { CONFIG } from './js/utils.js';
import { steamAppIDsFromGameNames } from './js/gameNames.js';
import { steamAppIDsFromSteamAccount } from './js/steamGames.js';
import { steamAppIDsFromGOGAccount } from './js/gogGames.js';
import { getEpicGamesGames } from './js/epicGames.js';
// ---------- Main ----------
await main();
async function main() {
// Depending on the chosen "mode" in the config file, run the corresponding function
switch (CONFIG.mode) {
case 'gameNames':
await steamAppIDsFromGameNames();
break;
case 'steamAccount':
await steamAppIDsFromSteamAccount();
break;
case 'gogAccount':
await steamAppIDsFromGOGAccount();
break;
case 'epicGamesAccount':
await getEpicGamesGames();
break;
default:
console.error(`Error: No mode provided in the configuration file, or mode not supported: ${CONFIG.mode}.`);
process.exit(1);
}
}