azurlane
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

AzurLane

Api wrapper for my azur lane api

Example

const { AzurLane, Category } = require("azurlane");
const azurlane = new AzurLane();
 
async function main() {
    // Get specific ship by name, in this case "Akagi"
    const ship = await azurlane.getShipByName("Akagi");
    console.log(`${ship.names.en}'s rarity is ${ship.rarity}`); // IJN Akagi's rarity is Super Rare
 
    // Get an array of ships with rarity "Super Rare"
    const ships = await azurlane.getShips(Category.RARITY, "Super Rare");
    for (let i = 0; i < ships.length; i++) {
        console.log(`[${ships[i].id}] = ${ships[i].name}`); // [036] = San Diego
    }
}
 
// Also catches any api errors that might occur like 400, 429, 500 http errors
// Api errors extend the default error class, have a look at https://azurlane-api.github.io/AzurLane/classes/apierror.html for information
main().catch(console.error);

Docs

I recommend looking at the api docs to see what data is returned before spamming the api with useless requests only to see what it actually returns.

Support

discord

Package Sidebar

Install

npm i azurlane

Weekly Downloads

12

Version

1.6.0

License

MIT

Unpacked Size

649 kB

Total Files

69

Last publish

Collaborators

  • kurozero