Client for the Anilist API
This is a Promise-returning client for the Anilist API. Aside from letting you make requests to the API it also refreshes your token automatically when it expires.
It works in both Node and the browser with a bundler like browerify or webpack.
$ npm install --save nani
var nani = require('nani').init(id, secret);
nani.get('anime/1')
.then(data => {
console.log(data);
})
.catch(error => {
console.log(error);
});
Sets up the nani
object with the given ID and secret.
Type: string
Your Anilist client ID.
Type: string
Your Anilist client secret.
Performs the given query and returns a promise that will be fulfilled with the results or rejected with an error.
Type: string
An Anilist API query. See all the possible ones in the Anilist documentation.
Performs a new token request with the object's ID and secret, puts the new token in the object, and returns a promise when done. This is done automatically for you so you probably never need to call this.
- nani-cli - CLI for this module
MIT © Juan Soto