1.0.2 • Published 3 years ago
purenodes.js v1.0.2
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
- Visit the panel
- Login with your credentials
- Click on the User-Icon in the upper right side of the panel
- Choose the Tab API Credentials
- Choose a Description
- Leave the IP field blank if you dont know what this means
- Click
Create
- Copy the API-Key. Dont share the API-Key with anyone. Purenodes will never ask you about the Key
- 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: NamegetUsage(serverID)
Get the server usage. Ex: RAMsetPowerState(serverID, state)
Start/Stop/Kill/Restart the server remotelycreateBackup(serverID)
Creates a new backup of your servergetBackupDetails(serverID, backupID)
Gives you details about a backup