Files
MercuryCloud_Dashboard/node_modules/@devnote-dev/pterojs
SavaletDev ffaeefa89e Update
2022-06-07 16:44:52 +02:00
..
2022-04-22 23:02:19 +02:00
2022-06-07 16:44:52 +02:00
2022-06-07 16:44:52 +02:00
2022-06-07 16:44:52 +02:00
2022-06-07 16:44:52 +02:00
2022-04-22 23:02:19 +02:00
2022-06-07 16:44:52 +02:00
2022-06-07 16:44:52 +02:00

PteroJS

A better API wrapper for Pterodactyl

About

PteroJS is a flexible API wrapper designed to give developers full access over the Pterodactyl API. The library uses a class-based management structure often seen in popular packages like Discord.js which keeps code clean, efficient and practical for any use-case.

Installing

npm install @devnote-dev/pterojs

Please join the support server if you experience package installation issues.

Setting Up

PteroJS uses separate classes for the client and application sides of the Pterodactyl API.

Using the application API

const { PteroApp } = require('@devnote-dev/pterojs');

// Initialising the application
const client = new PteroApp('your.domain.here', 'pterodactyl_api_key');

// Accessing information
client.servers.fetch('evuk98yu').then(console.log);

Using the client API

const { PteroClient } = require('@devnote-dev/pterojs');

// Initialising the client
const client = new PteroClient(
    'your.domain.here',
    'pterodactyl_api_key',
    { ws: true }
);

// Adding the server to listen for
const shard = client.addSocksetServer('kgujg66h');

// Listening to events
shard.on('statusUpdate', status => {
    console.log(`server ${shard.id} status: ${status}`);
});

// Connecting to the server
shard.connect();

Contributing

Please see the todo list or issues section for contributing ideas. New ideas are also welcome.

  1. Fork this repo!
  2. Make a branch from main (git branch -b <new-feature>)
  3. Commit your changes (git commit -am "...")
  4. Open a PR here (git push origin <new-feature>)

Contributors

This repository is managed under the MIT license.

© 2021-2022 devnote-dev