1.2.2 • Published 6 years ago

chinmei v1.2.2

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

chinmei npm version Travis CI Build Status

Node.js wrapper for MyAnimeList API

Description

Chinmei is a wrapper for MyAnimeList API. The strong point of Chinmei is the providing of a more accurate search with searchSingleAnime and searchSingleManga than the search method from MAL API.

Table of contents

Install

npm install chinmei

Usage

const Chinmei = require('chinmei');

var myChinmei = new Chinmei(username, password);

More examples are available in examples/.

Methods

User

setUser()

Change the current MyAnimeList user.

getUser()

Get the current user's id and username.

returns Promise<User>

verifyAuth()

Check if the user is valid.

returns Promise

getMalUser()

Get informations about a MyAnimeList user.

ParameterTypeDescriptionNotes
namestringName of the user you are looking for
typeintThe type of information you want1 = Anime, 2 = Manga (Default to anime)
statusstringStatus of information you are looking for? (Default to 'all')

returns Promise[MalUser](https://myanimelist.net/malappinfo.php?u=_julien&type=manga&status=all)

Search

searchAnimes(name)

Search for animes that correspond more or less.

ParameterTypeDescription
namestringName of the animes you are looking for

returns Promise[Animes](https://myanimelist.net/modules.php?go=api#animemangasearch)

searchMangas(name)

Search for mangas that correspond more or less.

ParameterTypeDescription
namestringName of the mangas you are looking for

returns Promise[Mangas](https://myanimelist.net/modules.php?go=api#animemangasearch)

searchSingleAnime(name)

Search for a single anime (more accurate than searchAnimes()).

ParameterTypeDescription
namestringName of the anime you are looking for

returns Promise[Anime](https://myanimelist.net/modules.php?go=api#animemangasearch)

searchSingleManga(name)

Search for a single manga (more accurate than searchMangas()).

ParameterTypeDescription
namestringName of the manga you are looking for

returns Promise[Manga](https://myanimelist.net/modules.php?go=api#animemangasearch)

Anime and Manga

addAnime(anime) & addManga(manga)

Add an anime/manga to the current user's anime/manga list.

ParameterTypeDescription
animeobjectAnime model
mangaobjectManga model

returns Promise containing response body

updateAnime(anime) & updateManga(manga)

Update an anime/manga of the current user's anime/manga list.

ParameterTypeDescription
animeobjectAnime model
mangaobjectManga model

returns Promise containing response body

deleteAnime(id) & deleteManga(id)

Delete an anime/manga of the current user's anime/manga list.

ParameterTypeDescription
idintId of the anime / manga you want to delete

returns Promise containing response body

Models

Notes

Even you pass a variable with a wrong type (eg: episode as '0' instead of 0) it will not cause any problem since Chinmei convert each value in the right type before sending them to MyAnimeList !

User model

ParameterTypeDescription
idstringCurrent user's id
usernamestringCurrent user's username

Anime model

ParameterTypeDescriptionNotes
idintid of the anime
episodeintNumber of episode viewed
statusint stringStatus of the anime1/watching, 2/completed, 3/onhold, 4/dropped, 6/plantowatch
scoreintScore of the animeMinimum is 1, maximum is 10
storage_typeintType of storage you have for this anime1 = Hard Drive, 2 = DVD/CD, 3 = None, 4 = Retail DVD, 5 = VHS, 6 = External HD, 7 = NAS, 8 = Blu-ray
storage_valuefloatValue of storageIf storage_type = 1, storage_value will correspond to Total drive space (GB). If storage_type = 8, it will be Total Blu-ray's
times_rewatchedintHow many time you re-watched this anime
rewatch_valueintRewatch rating to show how likely it is that you will watch it again1 = Very low, 2 = Low, 3 = Medium, 4 = High, 5 = Very high
date_startdateWhen you started watching this animeDate format doesn't matter, but should at least contain Year, Month and Day
date_finishdateWhen you finished this animeDate format doesn't matter, but should at least contain Year, Month and Day
priorityintYour priority level to watch this anime 0 = Low, 1 = Medium, 2 = High
enable_discussionint?0 = No, 1 = Yes
enable_rewatchingintIf you are currently rewatching this anime0 = No, 1 = Yes
commentsstringComments about this anime
tagsstring Tags about this animeYou should separate your tags with commas

Manga model

ParameterTypeDescriptionNotes
idintid of the manga
chapterintNumber of chapter read
volumeintNumber of volume read
statusint stringStatus of the manga1/reading, 2/completed, 3/onhold, 4/dropped, 6/plantoread
scoreintScore of the mangaMinimum is 1, maximum is 10
times_rereadintHow many time you have reread this manga
reread_valueintReread rating to show how likely it is that you will read it again1 = Very low, 2 = Low, 3 = Medium, 4 = High, 5 = Very high
date_startdateWhen you started reading this mangaDate format doesn't matter, but should at least contain Year, Month and Day
date_finishdateWhen you finished this mangaDate format doesn't matter, but should at least contain Year, Month and Day
priorityintYour priority level to read this manga 0 = Low, 1 = Medium, 2 = High
enable_discussionint?0 = No, 1 = Yes
enable_rereadingintIf you are currently rereading this manga0 = No, 1 = Yes
commentsstringComments about this manga
scan_groupstring?
tagsstring Tags about this mangaYou should separate your tags with commas
retail_volumesint How many retail volumes of this manga you have
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago