A simple wrapper around XenforoResourceManagerAPI(An API that exposes some SpigotMC information)
# Use your own package manager
npm install -S spigotmc-api
import { SpigotAPI } from "spigotmc-api";
const api = new SpigotAPI();
const authorResponse = await api.author.find("xrexy");
if (authorResponse.status === "error") {
console.log(authorResponse.error, authorResponse.code);
console.log(authorResponse.exception);
return;
}
const author = authorResponse.value;
if (author === null) {
console.log("Author not found");
return;
}
const resourcesResponse = await api.resource.byAuthor(author.id.toString());
if (resourcesResponse.status === "success") {
console.log(
`Found ${resourcesResponse.value.length} resources by ${author.username}`
);
}