Skip to content
On this page

Getting Started

Installation

bash
npm install --save @tutkli/jikan-ts
# or
yarn add @tutkli/jikan-ts # recommended

Basic Example

Using a specific client, like AnimeClient:

ts
import { AnimeClient, JikanResponse, Anime } from '@tutkli/jikan-ts';

(async () => {
    const animeClient = new AnimeClient();

    await animeClient
        .getAnimeById(1)
        .then((jikanResponse: JikanResponse<Anime>) => console.log(jikanResponse.data.title)) // will output "Cowboy Bebob"
        .catch((error) => console.error(error));
})();

Or, using the JikanClient:

ts
import { JikanClient, JikanResponse, Anime } from '@tutkli/jikan-ts';

(async () => {
  const jikanClient = new JikanClient();

  await jikanClient.anime
    .getAnimeById(1)
    .then((jikanResponse: JikanResponse<Anime>) => console.log(jikanResponse.data.title)) // will output "Cowboy Bebob"
    .catch((error) => console.error(error));
})();

Leave you feedback