2.1.5 • Published 1 year ago

@avionrx/pterodactyl-js v2.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Pterodactyl.js

Pterodactyl.js is currently a node.js only wrapper which interfaces with the Client and Admin API on the Pterodactyl Panel. It is a fully object-oriented library which utilizes almost all functions within the API routes. The functions put forth allow for individual fields to be edited as well as all at once. This permits for creating, reading, updating and deleting for any resource in the Admin API. This library is also written in TypeScript with a comprehensive type declaration along with it.

Pterodactyl.js uses promises for handling of the data that is provided along with update functions.

Installation

To install pterodactyl.js, you must either use NPM or Yarn.

NPM

npm i pterodactyl.js

Yarn

yarn add pterodactyl.js

Basic Usage

Admin API

const Pterodactyl = require('pterodactyl.js');

const client = new Pterodactyl.Builder()
    .setURL('https://pterodactyl.app/')
    .setAPIKey('API Key')
    .asAdmin();

client.getServers()
.then(async servers => {
    let server = servers[0];

    console.log(server.toJSON());
}).catch(error => console.log(error));

User API

const Pterodactyl = require('pterodactyl.js');

const client = new Pterodactyl.Builder()
    .setURL('https://pterodactyl.app/')
    .setAPIKey('API Key')
    .asUser();

client.getClientServers()
.then(async servers => {
    let server = servers[0];

    console.log(server.toJSON());

    await server.start();

    await server.sendCommand('help');
}).catch(error => console.log(error));

Examples

Linking System

2.1.4

1 year ago

2.1.5

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.0.9

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago