Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

open-critic-node

MorpheusZero86MIT1.0.0TypeScript support: included

A NodeJS Wrapper for the Open Critic API

open critic api, video game api, video games

readme

open-critic-node

A NodeJS Wrapper for the Open Critic API

Installation

npm -i open-critic-node

Usage

First import the client:

Typescript

import { OpenCriticClient } from "open-critic-node";

Javascript CommonJS

const OpenCriticClient = require("open-critic-node").OpenCriticClient;

Method Examples

I'll just be showing examples in Typescript from here on out. The typings are included in the lib so check it out!

// Instantiate a new client.
const client = new OpenCriticClient();

// Get the first page of PS5 games (game summary only)
const games = await client.getGames({
    page: 0,
    platforms: [
        PlatformType.SONY_PLAYSTATION_5
    ],
});

// Get a game's details by its ID. (This example is the ID for Demon's Souls)
const game = await client.getGameById(10255);