0.0.1 • Published 5 years ago
esm-myanimelist-tests v0.0.1
Node-MyAnimeList
Node-MyAnimeList is a small promise based package for downloading information from MyAnimeList. Node-MyAnimeList is using Jikan.moe API and flew methods created by me specially for this package
Intellisens Support (Typescript)
Instalation
npm i node-myanimelist
Import
const { Mal } = require("node-myanimelist");
// Or
import Mal from 'node-myanimelist';
Responses
Data is always returned with promise. Data is actually raw axios response object so to get jikanApi json object you have to use:
.then(res => res.data) //Data is jikanApi response
Jikan methods return unmodified jikanApi responses, to see all of them visit jikanDocs
List of functions
For more detalis visit wiki
- JikanApi Methods Mal.anime(id) anime.info() List of all endpoints Mal.manga(id) manga.info() List of all endpoints Mal.person(id) person.info() person.pictures() Mal.character(id) character.info() character.pictures() Mal.search() search.anime(params) search.manga(params) search.person(params) search.character(params) Mal.season(year,season) Mal.seasonArchive() Mal.seasonLater() Mal.schedule() schedule.all() schedule.monday() List of all endpoints Mal.top() top.anime() topAnime.all() topAnime.upcoming() List of all endpoints Mal.genre() genre.anime(genreId) genre.manga(genreId) Mal.producer(id, page?) Mal.magazine(id, page?) Mal.user(username) user.profile() user.history() history.all() history.anime() history.manga() user.animelist(page?) animelist.all(params?) animelist.watching(params?) user.mangalist(page?) mangalist.all(params?) mangalist.reading(params?) List of all endpoints Mal.club(id) club.info() club.members(page?)
Buildin Scraper
import { ScraperClient } from "node-myanimelist";
const scraperClient = new ScraperClient();
// Login into Mal acount
let loginData = await scraperClient.login("username","password");
// loginData == {
// MALSESSIONID: "***",
// csrf_token: "***"
// };
// Get Mal User Notifications
let notifications = await scraperClient.notifications(loginData);
// Update Episode On Mal
const animeUpdate = {
num_watched_episodes: 20,
anime_id: 24833,
status: 1
};
let res = await scraperClient.animeEdit(loginData,animeUpdate);
Notifications response example
0.0.1
5 years ago