/spiget-typescript

[WIP] Typescript/Javascript Spiget client

Primary LanguageTypeScriptMIT LicenseMIT

spiget-typescript

Typescript/Javascript Spiget API client

GitHub tag (latest by date) npm

npm install spiget

Quick Start

const {Spiget} = require("spiget");
const spiget = new Spiget("MyExampleSpigetApp");

spiget.getAuthor(6643).then(author => {
    console.log(author);

    author.getResources().then(resources => {
        console.log(resources);
    });
});

Async / Await

const {Spiget} = require("spiget");
const spiget = new Spiget("MyExampleSpigetApp");

async function start() {
    const author = await spiget.getAuthor(6643);
    console.log(author);

    const resources = await author.getResources();
    console.log(resources);
}

start();