<commit_before># MALjs

A promise based json api wrapper for the MAL (myanimelist) api. http://myanimelist.net/modules.php?go=api

This api has not been tested in production environments, use at your own risk. 

### Support
ES6 files need to be converted to ES5 to ensure maximum browser support. Polyfills for the Promise API need to be included in browsers that lack support. See the `polyfills/` directory for an example for a polyfill script.

### Usage

Anime calls are made with `API.anime.METHOD`, manga calls with `API.manga.METHOD`. See below for an example.

```js
// create an new api instance with your myanimelist user name and password
const mal = new MALjs('MAL username', 'MAL password');

// search my animelist
mal.anime.search('search string')
  .then(result => result) // contains the json result on success
  .catch(err => err); // contains an error message if the request fails

// Get the authenticated users animelist
mal.anime.list()
  .then(result => result)
  .catch(err => err);

// adds an anime to the list
mal.anime.add('71', { // '71' is the animes ID (retrieved from search())
  episode: "1",<commit_msg>update docs<commit_after># MALjs

A promise based json api wrapper for the MAL (myanimelist) api. http://myanimelist.net/modules.php?go=api

This api has not been tested in production environments. 

### Support
All api requests return promises. Use a Promise polyfill where neccesarry.
For browsers that don't support ES6 see the es5 file in the `es5/` directory.

### Usage

Anime calls are made with `API.anime.METHOD`, manga calls with `API.manga.METHOD`. See below for an example.

```js
// create an new api instance with your myanimelist user name and password
const mal = new MALjs('MAL username', 'MAL password');

// search my animelist
mal.anime.search('search string')
  .then(result => result) // contains the json result on success
  .catch(err => err); // contains an error message if the request fails

// Get the authenticated users animelist
mal.anime.list()
  .then(result => result)
  .catch(err => err);

// adds an anime to the list
mal.anime.add('71', { // '71' is the animes ID (retrieved from search())
  episode: "1",
{'fraction_non_alphanumeric': 0.10550458715596331, 'fraction_numerical': 0.006880733944954129, 'mean_word_length': 3.956818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1130703', 'n_tokens_mistral': 665, 'n_tokens_neox': 628, 'n_words': 288}