thegameapi
v1.0.4
Published
Locate game data from 3kh0-Games on GitHub. Along with a playable link.
Downloads
1
Readme
The Game API
A simple npm package to locate games from 3kh0-Assets by ID, title, and URL.
Installation
npm install thegameapi
Usage
const gamedb = require("thegameapi");
// Fetch game data by ID
const gameDataById = gamedb.locateGameById("1");
console.log(gameDataById);
if (gameDataById) {
const gameUrl = gameDataById.url;
console.log(gameUrl);
}
// Fetch game data by title
const gameDataByTitle = gamedb.locateGameByTitle("Game 1");
console.log(gameDataByTitle);
// Fetch game data by URL
const gameDataByUrl = gamedb.locateGameByUrl("https://tlochsta.media/embed/1");
console.log(gameDataByUrl);
// Fetch the whole list of games
const gameList = gamedb.fetchGameList();
console.log(gameList);
API
locateGameById(gameId: string): object | null
Locate a game by its ID.
locateGameByTitle(title: string): object | null
Locate a game by its title.
locateGameByUrl(url: string): object | null
Locate a game by its URL.
fetchGameList(): Array<object>
Fetch the entire list of games as an array.
Contributing
If you find any issues or have suggestions, feel free to open an issue or submit a pull request.