1.2.2 • Published 4 days ago
@tutkli/jikan-ts v1.2.2
jikan-ts
Jikan API wrapper for Typescript and NodeJS with build in typings.
Features
- 💅 Fully typed
- ♻ Http Request Cache
- 📄 Logging
- 📦 ESM with tree shaking support
Installation
npm install --save @tutkli/jikan-ts axios axios-cache-interceptor
# or
yarn add @tutkli/jikan-ts axios axios-cache-interceptor
Example
Using a specific client, like AnimeClient:
import { AnimeClient, JikanResponse, Anime } from '@tutkli/jikan-ts';
const animeClient = new AnimeClient();
animeClient
.getAnimeById(1)
.then((jikanResponse: JikanResponse<Anime>) => {
/* ... */
})
.catch(error => console.error(error));
Or, using the JikanClient:
import { JikanClient, JikanResponse, Anime } from '@tutkli/jikan-ts';
const jikanClient = new JikanClient();
jikanClient.anime
.getAnimeById(1)
.then((jikanResponse: JikanResponse<Anime>) => {
/* ... */
})
.catch(error => console.error(error));
Client configuration
Cache Configuration
Jikan-ts uses axios-cache-interceptor
to store request results.
To use a specific configuration, pass the cacheOptions
argument when instantiating a client:
import { AnimeClient } from '@tutkli/jikan-ts';
const animeClient = new AnimeClient({
cacheOptions: { ... } // axios-cache-interceptor options
}
);
For more information, check out the axios-cache-interceptor Documentation.
Logging
To enable logging, pass the enableLogging
argument as true
.
import { AnimeClient } from '@tutkli/jikan-ts';
const animeClient = new AnimeClient({
enableLogging: true,
});
Available Clients
- AnimeClient
- CharactersClient
- GenresClient
- MangaClient
- TopClient
- SchedulesClient
- SeasonsClient
- JikanClient (Main client)
Leave you feedback
- Did you find this project useful? Leave a ⭐
- Found a problem? Create an issue 🔎
- Want to contribute? Submit a PR 📑
1.2.2
4 days ago
1.2.1
3 months ago
1.2.0
3 months ago
1.1.0
3 months ago
1.0.1
9 months ago
1.0.0
11 months ago
0.6.62
1 year ago
0.6.61
1 year ago
0.6.6
1 year ago
0.6.3
1 year ago
0.6.2
1 year ago
0.6.5
1 year ago
0.6.4
1 year ago
0.6.1
1 year ago
0.6.0
1 year ago
0.5.52
1 year ago
0.5.51
1 year ago
0.5.5
1 year ago
0.5.42
1 year ago
0.5.41
1 year ago
0.5.4
1 year ago
0.5.3
1 year ago
0.5.2
1 year ago
0.5.1
1 year ago
0.5.0
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago