Coder Social home page Coder Social logo

thisisset-l / pterodactyl.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redstonegamez/pterodactyl.js

0.0 1.0 0.0 84 KB

JavaScript API Wrapper for the Pterodactyl Panel

Home Page: https://npmjs.com/package/pterodactyl.js

TypeScript 100.00%

pterodactyl.js's Introduction

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

pterodactyl.js's People

Contributors

redstonegamez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.