Jikan.js - Unofficial Jikan API Wrapper for Deno π
Jikan.js is a simple, efficient, and easy-to-use library for interacting with the Jikan API β a RESTful API that brings MyAnimeList data to your fingertips!
Built with β€οΈ in TypeScript, Jikan.js is designed for Deno and comes with powerful features like rate-limiting, caching, and self-hosted API support. Whether you're building the next anime tracker or just want to fetch your favorite characters, Jikan.js has you covered!
β οΈ Heads up! This library is still a work in progress. The first release is coming soon, but you're welcome to follow along and share your feedback! π
π Getting Started
π οΈ Importing the Library
Note: This library isnβt on the Deno registry yet. Stay tuned for updates!
To try it out now:
import { JikanClient } from "https://raw.githubusercontent.com/RPDJF/Jikan.js/refs/heads/main/src/mod.ts";
π― Example Usage
Take a look at JikanClient facade methods
Here is an example of how you can use the library to fetch data from the Jikan API:
const client = new JikanClient(); client.getCharacter(1).then((character) => { console.log(character.name); });
The library will fully support Jikan API v4, meaning you can make the same queries as you would on the official Jikan API:
client.getMangas({ page: 5, limit: 5, order_by: "popularity", sort: "desc", }).then((mangas) => { console.log(mangas); });
Pro Tip: The client requests may throw errors, so itβs a good idea to wrap them in a try-catch block:
try { const character = await client.getCharacter(1); console.log(character.name); } catch (error) { console.error(error); }
π Self-Hosted Jikan API
const client = new JikanClient({ host: "https://my-jikan-api.com", baseUri: "/v4", });
βοΈ DEBUG Mode
You can enable debug mode to see detailed logs: Linux/MacOS:
export DEBUG=true
Windows:
set DEBUG=true
Then simply run your program as usual.
β¨ Letβs build something awesome together! β¨