
Security News
Federal Audit Finds NIST Wasted Funds With No Plan to Clear NVD Backlog
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.
mal-api-ts is an api wrapper for the myanimelist api that makes it fast, easy and fun to interact with mal. supports all endpoints, has interfaces for every response, and most importantly, saves you a lot of time.
mal-api.ts is a typescript api wrapper for the myanimelist api that makes it fast, easy and fun to interact with mal. supports all endpoints, has interfaces for every response, and most importantly, saves you a lot of time.
npm install malts
import { MAL } from "malts";
const mal = new MAL("CLIENT_ID", "CLIENT_SECRET", "REDIRECT_URI");
async function getAnime() {
const anime = await mal.anime.get({ id: 21, fieldPreset: FIELD_PRESET.FULL }); // Gets
// all the details for anime ID 21
console.log(anime);
}
getAnime();
This project has full & detailed JSDocs available for ease of programming. This list will not contain all of the available arguments, just a list of available methods. For more information, refer to the JSDocs.
// Get an anime by its ID.
mal.anime.get({ id: 21 });
// Search for an anime.
mal.anime.search({ query: "One Piece" });
// Get top ranking anime.
mal.anime.top();
// Get anime by season.
mal.anime.season({ season: "FALL 2020"}) // or "current" for current season.
// Get a manga by its ID.
mal.manga.get({ id: 43661 });
// Search for a manga.
mal.manga.search({ query: "Owari No Seraph" });
// Get top ranking manga.
mal.manga.top();
The examples below require authentication. This wrapper has OAuth2 helper functions that are listed below. To just authenticate a user:
// Authenticate a user.
mal.user.auth("ACCESS_TOKEN", "REFRESH_TOKEN_(OPTIONAL)");
// Fetch user's information.
mal.user.info();
// Get anime suggested for user based on their list.
mal.user.suggested();
// Fetch a user's anime list.
// THIS DOES NOT REQUIRE AUTHENTICATION, UNLIKE THE REST OF THE METHODS.
// You can pass an optional username argument.
// But note that if a user's anime list is private, it
// cannot be fetched without authentication.
mal.user.animelist.get();
// Update a user's anime list.
mal.user.animelist.update({ id: 21, status: WATCHING_STATUS_UPDATE.COMPLETED })
// or status: "completed"
// Delete an entry from user's anime list.
mal.user.animelist.delete({ id: 21 });
// Fetch a user's manga list.
// THIS DOES NOT REQUIRE AUTHENTICATION, UNLIKE THE REST OF THE METHODS.
// You can pass an optional username argument.
// But note that if a user's manga list is private, it
// cannot be fetched without authentication.
mal.user.mangalist.get();
// Update a user's manga list.
mal.user.mangalist.update({ id: 43661, status: READING_STATUS_UPDATE.READING, chapter: 54 })
// or status: "reading"
// Delete an entry from user's manga list.
mal.user.mangalist.delete({ id: 43661 });
// Get a link for a user to authenticate themselves. In order to use this,
// you must have passed Client ID, Client Secret (if your app is web) and
// a redirect URL when initializing MAL.
mal.oauth.get_link();
// Exchange the code you receive as a URL query once a user authenticates
// themselves for an Access and Refresh token.
// Code is taken from the URL query, State & Code_Verifier are returned from
// get_link() alongside with the URL.
mal.oauth.verify_login("CODE", "STATE", "CODE_VERIFIER");
// Refresh an access token via the refresh token.
mal.oauth.refresh_access_token("REFRESH_TOKEN");
// Check if an access token is expired.
mal.oauth.is_token_expired("ACCESS_TOKEN");
// Get an access token's expiration datetime (in unix format).
mal.oauth.get_token_expiration("ACCESS TOKEN");
Pagination is fully supported and made as simple as it can be for any method that can have multiple pages of results.
// Fetch some random search results.
const results = await mal.anime.search({ query: "Owari No Seraph" });
// Fetch the next page.
if (results?.next) {
const secondPage = await results.next();
}
or
// Fetch the first page of results
let results = await mal.anime.search({ query: "Owari No Seraph" });
const fullResults = results?.results;
// While-loop until no more pages
while (results?.next) {
results = await results.next();
fullResults.push(...results?.results);
}
Any contributions are welcome and very appreciated. 💝
git clone https://github.com/Shikiiii/mal.ts.gitnpm installgit checkout -b feature-namegit commit -m "Add feature"git push origin feature-nameThis project is licensed under the MIT License. See the LICENSE file for details.
FAQs
mal-api-ts is an api wrapper for the myanimelist api that makes it fast, easy and fun to interact with mal. supports all endpoints, has interfaces for every response, and most importantly, saves you a lot of time.
We found that mal-api-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.