1.0.2 • Published 3 years ago

purenodes.js v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Installation

You can either install it via npm and yarn:

npm install --save purenodes.js
yarn add purenodes.js

or if you need to install it in Purenodes:

Add "purenodes.js": "latest" at the end of your dependencies in package.json file

Requirements

API Key - User API Key of PureNodes

How to get API-KEY

  1. Visit the panel
  2. Login with your credentials
  3. Click on the User-Icon in the upper right side of the panel
  4. Choose the Tab API Credentials
  5. Choose a Description
  6. Leave the IP field blank if you dont know what this means
  7. Click Create
  8. Copy the API-Key. Dont share the API-Key with anyone. Purenodes will never ask you about the Key
  9. Use the key for controlling your server and to get data

Example

Synchronous:

const PureNodes = require("purenodes.js");
const pn = new PureNodes("USER_API_KEY");

pn.getUsage("SERVER_ID").then(console.log);

Asynchronous:

const PureNodes = require("purenodes.js");
const pn = new PureNodes("USER_API_KEY");

let data = await pn.getUsage("SERVER_ID");
console.log(data);

Reference

serverID = Your Bot/Server ID

backupID = Your Backup ID

state = Power State (can be: start, stop, restart, kill)

  • getDetails(serverID) Get all server informations. Ex: Name
  • getUsage(serverID) Get the server usage. Ex: RAM
  • setPowerState(serverID, state) Start/Stop/Kill/Restart the server remotely
  • createBackup(serverID) Creates a new backup of your server
  • getBackupDetails(serverID, backupID) Gives you details about a backup

Links