0.0.1 • Published 5 years ago

esm-myanimelist-tests v0.0.1

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

NodeMal API Banner

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)

Gif

Instalation

NPM

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

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