Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including chinmei with all npm packages installed. Try it out:

var chinmei = require("chinmei")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

chinmei v1.2.2

Node.js wrapper for MyAnimeList API

chinmei npm version Travis CI Build Status

Node.js wrapper for MyAnimeList API

Chinmei

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>

Search

searchAnimes(name)

Search for animes that correspond more or less.

ParameterTypeDescription
namestringName of the animes you are looking for

returns Promise<Animes>

searchMangas(name)

Search for mangas that correspond more or less.

ParameterTypeDescription
namestringName of the mangas you are looking for

returns Promise<Mangas>

searchSingleAnime(name)

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

ParameterTypeDescription
namestringName of the anime you are looking for

returns Promise<Anime>

searchSingleManga(name)

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

ParameterTypeDescription
namestringName of the manga you are looking for

returns Promise<Manga>

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 anime0 = 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
tagsstringTags 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 manga0 = 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?
tagsstringTags about this mangaYou should separate your tags with commas
retail_volumesintHow many retail volumes of this manga you have
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free