An unofficial Node.js wrapper for the Mush API. Handling all the annoying stuff for you!
Note
The typings were generated based on data collected from multiple players and may be wrong and change over time.
| Package Manager | Command |
|---|---|
| npm | npm install mush-api.js |
| pnpm | pnpm add mush-api.js |
| yarn | yarn add mush-api.js |
import * as mush from "mush-api.js";
// const mush = require("mush-api.js");
try {
const player = await mush.getPlayer("yPandinho");
console.log(player.username); // yPandinho
console.log(player.rank.name); // Admin
console.log(player.bedwars.wins); // 29
} catch (error) {
if (error instanceof mush.MushAPIJSError) {
console.log(error.message); // Entity not found
console.log(error.statusCode); // 404
}
}Contributions are always welcome! You can contribute by opening a pull request or submitting a bug or feature idea.