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

0.0.2 • Public • Published

Spigot TS API

A simple wrapper around XenforoResourceManagerAPI(An API that exposes some SpigotMC information)

Installation

# Use your own package manager
npm install -S spigotmc-api

Usage

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}`
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i spigotmc-api

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

21.7 kB

Total Files

22

Last publish

Collaborators

  • xrexy