1.2.2 • Published 4 months ago

aniki v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Installation

With NPM:

npm i aniki

Alpha

An alpha version (1.3.0) will be released soon as possible (I WORK A LOT FOR NOTHING LOL), the module has been restructured in TypeScript, you can still use it in JavaScript ESM.

Api used

Kitsu.io (For anime and manga)

Helping

Do you have an anime/manga api to suggest? Tell me in X! (The api must not have an access key.)

Usage

With Kitsu:

const { AnimeKitsu } = require("aniki/kitsu");

const anime = new AnimeKitsu();

// Find anime.
anime.find("name").then(results => {
	console.log(results.data[0]) // The 0 is the first result, data are required.

    // Tips: If you want to make sure you have any data, make a condition like this:
    if (results.data.length > 0) {
        // ...
    } else {
        // ...
    }
});

// All list from the page, 
anime.list(0).then(animes => { // 0 is the offset (first page)
  console.log(animes)
});

With Kitsu for manga:

const { MangaKitsu } = require("aniki/kitsu");

const manga = new MangaKitsu();

// Find anime.
manga.find("name", 0).then(results => {
    console.log(results.data[0]);
});

// Get a list.
manga.list(0).then(mangas => {
    console.log(mangas);
});

Important

If you use all function at one time, use asynchronous function:

async function yourFunc() {
  await anime.find("name", 0).then(results => {
	  console.log(results.data[0]);
  });
 
  await anime.list(0).then(animes => {
	  console.log(animes.data[0]);
  });

  await manga.find("name", 0).then(results => {
    console.log(results.data[0]);
  });
  // ...
};
yourFunc();

Kitsu Anime Response

AttributesDescriptionType
titlesAll type of titleobject
titles > enThe english titlestring
titles > jpThe japanese titlestring
titles > ja_jpThe japanese character titlestring
canonicalTitleThe canonical titlestring
abbreviatedTitlesThe abbreviated titlesarray
synopsisThe synopsis of the anime (description)string
createdAtThe creation date (ISO 8601)string
startAtThe start date (YYYY-MM-DD)string
updatedAtThe updated date (ISO 8601)string
endAtThe end date (YYYY-MM-DD)string
posterImageThe poster imageobject
posterImage > tinyThe tiny poster imagestring
posterImage > smallThe small poster imagestring
posterImage > mediumThe medium poster imagestring
posterImage > largeThe large poster imagestring
posterImage > originalThe original poster imagestring
coverImageThe poster imageobject
coverImage > tinyThe tiny poster imagestring
coverImage > smallThe small poster imagestring
coverImage > largeThe large poster imagestring
posterImage > originalThe original poster imagestring
episodeCountThe number of episodesnumber
episodeLengthThe approximative duration of the episodenumber
nsfwIf the anime are NSFW content or not (must use authentication system.)boolean
youtubeVideoIdThe trailer video idstring
ageRatingThe age rating"enum"
subtypeThe subtype"enum"

Kitsu JSON Response

Example with an anime search

{
    "data": [
        {
            "id": "",
            "type": "",
            "links": {
                "self": ""
            },
            "attributes": {
                "createdAt": "",
                "updatedAt": "",
                "slug": "",
                "synopsis": "",
                "description": "",
                "coverImageTopOffset": 0,
                "titles": {
                    "en_jp": "",
                    "ja_jp": ""
                },
                "canonicalTitle": "",
                "abbreviatedTitles": [
                    ""
                ],
                "averageRating": "",
                "ratingFrequencies": {
                    "2": "",
                    "3": "",
                    "4": "",
                    "5": "",
                    "6": "",
                    "7": "",
                    "8": "",
                    "9": "",
                    "10": "",
                    "11": "",
                    "12": "",
                    "13": "",
                    "14": "",
                    "15": "",
                    "16": "",
                    "17": "",
                    "18": "",
                    "19": "",
                    "20": ""
                },
                "userCount": 0,
                "favoritesCount": 0,
                "startDate": "0000-00-00",
                "endDate": "0000-00-00",
                "nextRelease": null,
                "popularityRank": 0,
                "ratingRank": 0,
                "ageRating": "",
                "ageRatingGuide": "",
                "subtype": "",
                "status": "",
                "tba": "",
                "posterImage": {
                    "tiny": "",
                    "large": "",
                    "small": "",
                    "medium": "",
                    "original": "",
                    "meta": {
                        "dimensions": {
                            "tiny": {
                                "width": 0,
                                "height": 0
                            },
                            "large": {
                                "width": 0,
                                "height": 0
                            },
                            "small": {
                                "width": 0,
                                "height": 0
                            },
                            "medium": {
                                "width": 0,
                                "height": 0
                            }
                        }
                    }
                },
                "coverImage": {
                    "tiny": "",
                    "large": "",
                    "small": "",
                    "original": "",
                    "meta": {
                        "dimensions": {
                            "tiny": {
                                "width": 0,
                                "height": 0
                            },
                            "large": {
                                "width": 0,
                                "height": 0
                            },
                            "small": {
                                "width": 0,
                                "height": 0
                            }
                        }
                    }
                },
                "episodeCount": 0,
                "episodeLength": 0,
                "totalLength": 0,
                "youtubeVideoId": "",
                "showType": "",
                "nsfw": false
            },
            "relationships": {
                "genres": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "categories": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "castings": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "installments": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "mappings": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "reviews": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "mediaRelationships": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "characters": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "staff": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "productions": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "quotes": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "episodes": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "streamingLinks": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "animeProductions": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "animeCharacters": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                },
                "animeStaff": {
                    "links": {
                        "self": "",
                        "related": ""
                    }
                }
            }
        }
    ],
    "meta": {
        "count": 0
    },
    "links": {
        "first": "",
        "last": ""
    }
}
1.2.2

4 months ago

1.2.1

5 months ago

1.2.0

9 months ago

1.1.6

9 months ago

1.2.0-beta.2.2

9 months ago

1.1.5

9 months ago

1.2.0-beta.2.3

9 months ago

1.1.4

9 months ago

1.1.3

10 months ago

1.2.0-beta.2.1

9 months ago

1.2.0-beta.1

9 months ago

1.2.0-beta.2

9 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.1.2

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

0.0.30

2 years ago

0.0.28

2 years ago

0.0.25

2 years ago

0.0.9

3 years ago

1.0.0

8 years ago