Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 874 Bytes

README.md

File metadata and controls

36 lines (28 loc) · 874 Bytes

ServerJars

ServerJars-API

The Node JavaScript API for ServerJars

NPM

Code Examples:

Fetching the latest Jar:

const ServerJars = require('serverjars-api');

ServerJars.fetchLatest('spigot').then(jar => {
    console.log(jar.version);
}).catch(console.log);

Fetching the all Jars:

const ServerJars = require('serverjars-api');

ServerJars.fetchAll('spigot').then(jars => {
    console.log(jars)
}).catch(console.log);

Downloading Jars:

const ServerJars = require('serverjars-api');

ServerJars.downloadJar('spigot', '1.14.4', './spigot-1.14.4.jar').then(stream => {
    stream.on('finish', () => {
        console.log('Downloaded')
    })
}).catch(console.log);