1.0.4 • Published 5 months ago

thegameapi v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

The Game API

npm version

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.

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

6 months ago

1.0.0

6 months ago