npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

popura

v1.2.5

Published

Promise-returning wrapper for MyAnimeList API

Downloads

9

Readme

#popura

NodeJS wrapper for MyAnimeList API

npm version Travis CI Build Status Coverage Status XO code style

Popura is a promise-returning wrapper for MAL API.

Table of Contents

Install

$ npm install --save popura

Usage

import popura from 'popura';
const client = popura('YourAwesomeUsername', 'YourHackablePassword');

client.getAnimeList()
  .then(res => console.log(res))
  .catch(err => console.log(err));

API

.getUser()

Return the current user's username.

.setUser(username, password)

Change the current user in this client instance.

.verifyAuth()

Check if this user is valid.

Returns Promise => {id, username}.

.searchAnimes(name) and .searchMangas(name)

Search for an anime or manga title by name.

Returns Promise => Array of Anime Models | Manga Models.

.getAnimeList(username = this.user) and .getMangaList(username = this.user)

Get the animelist or mangalist from an user. If username is empty, returns current user's list.

Returns Promise => {myinfo, list} where myinfo is a Myinfo Model and list is an array of Anime List Item Models | Manga List Item Models.

.addAnime(id, values = {}) and .addManga(id, values = {})

Inserts an anime or manga with id into your list. Optionally you can define values from Anime Models | Manga Models.

Returns Promise => Raw response.body.

.updateAnime(id, values = {}) and updateManga(id, values = {})

Changes values from an anime or manga with id in your list. Define values from Anime Models | Manga Models.

Returns Promise => Raw response.body.

.deleteAnime(id) and deleteManga(id)

Removes an anime or manga with id from your list.

Returns Promise => Raw response.body.

Models

Anime Model

Model used to add/update animes

Property | Type | Note -------- | ---- | ---- episode | int status | int or string | 1 / watching, 2 / completed, 3 / onhold, 4 / dropped, 6 / plantowatch score | int storage_type | int storage_value | float times_rewatched | int rewatch_value | int date_start | date | mmddyyyy date_finish | date | mmddyyyy priority | int enable_discussion | int | 1 = enable, 0 = disable enable_rewatching | int | 1 = enable, 0 = disable comments | string fansub_group | string tags | array

Manga Model

Model used to add/update mangas

Property | Type | Note -------- | ---- | ---- chapter | int volume | int status | int or string | 1 / reading, 2 / completed, 3 / onhold, 4 / dropped, 6 / plantoread score | int times_reread | int reread_value | int date_start | date | mmddyyyy date_finish | date | mmddyyyy priority | int enable_discussion | int | 1 = enable, 0 = disable enable_rereading | int | 1 = enable, 0 = disable comments | string scan_group | string tags | array retail_volumes | int

Anime List Item Model

Model you receive from API when requesting anime list

Property | Type | Note -------- | ---- | ---- series_animedb_id | int series_title | string series_synonyms | array series_type | int | TODO: figure out the meaning of these ints series_episodes | int series_status | int | TODO: figure out the meaning of these ints series_start | date | mmddyyyy series_end | date | mmddyyyy my_id | int my_watched_episodes | int my_start_date | date | mmddyyyy my_finish_date | date | mmddyyyy my_score | int my_status | int | 1 = watching, 2 = completed, 3 = onhold, 4 = dropped, 6 = plantowatch my_rewatching | int my_rewatching_ep | int my_last_updated | date | mmddyyyy my_tags | array

Manga List Item Model

Model you receive from API when requesting anime list

Property | Type | Note -------- | ---- | ---- series_mangadb_id | int series_title | string series_synonyms | array series_type | int | TODO: figure out the meaning of these ints series_chapters | int series_volumes | int series_status | int | TODO: figure out the meaning of these ints series_start | date | mmddyyyy series_end | date | mmddyyyy my_id | int my_read_chapters | int my_read_volumes | int my_start_date | date | mmddyyyy my_finish_date | date | mmddyyyy my_score | int my_status | int | 1 = reading, 2 = completed, 3 = onhold, 4 = dropped, 6 = plantoread my_rereading | int my_rereading_chap | int my_last_updated | date | mmddyyyy my_tags | array

Myinfo Model

Property | Type | Note -------- | ---- | ---- user_id | int user_name | string user_watching | int | Only for anime user_reading | int | Only for manga user_completed | int user_onhold | int user_dropped | int user_plantowatch | int | Only for anime user_plantoread | int | Only for manga user_days_spent_watching | float | Yes, they use 'watching' for manga too

Development

After clonning this repo, you must copy .env.sample to .env and put your MAL username and password.

In some tests, it'll add, update and remove one anime and one manga from your lists. You can specify these two at .env. Defaults to anime Tachumaru Gekijou (id = 9562) and manga Junshin Miracle 100% (id = 94483), two not so known titles.

License

MIT