npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vertexnodes-js

v1.0.0

Published

Get your bot's details and control it without having to access the panel!

Downloads

4

Readme

Vertexnodes Banner

Get your bot's details and control it without having to access the panel! (hosted on VertexNodes)

How to get API Key

  1. Visit the panel here.
  2. Click on the user icon in the top-right. Click on the user icon
  3. Click on the "API Credentials" tab. Click "API Credentials" tab.
  4. Enter a name for the key and click "Create Key". Click "Create Key"

How to get Server ID

  1. Visit the panel here.
  2. Click on your server's name.
  3. Navigate to the "Settings Tab".
  4. You will see your server ID under "DEBUG INFORMATION" tab.

Installation

Installation is done using the npm install command:

$ npm install vertexnodes-js

Examples

getServerUsage()

Get usage of the server.

Parameters: ServerID

const VertexNodes = require("vertexnodes-js");
const host = new VertexNodes("API KEY");

host.getServerUsage("server ID").then(usage => {
   console.log(usage);
}).catch(err => console.log(err));

Returns a JSON object like this:

{
  memory_bytes: 22933504,
  cpu_absolute: 0,
  disk_bytes: 8456083,
  network_rx_bytes: 1762592,
  network_tx_bytes: 46024
}

getServerDetails

Get details of the server.

Parameters: ServerID

const VertexNodes = require("vertexnodes-js");
const host = new VertexNodes("API KEY");

host.getServerDetails("server ID").then(details => {
   console.log(details);
}).catch(err => console.log(err));

Returns a JSON object like this:

{
  server_owner: true,
  identifier: '05314470',
  internal_id: 2088,
  uuid: '05314470-0bee-4ab8-83c4-15d9f4d077d0',
  name: 'Server',
  node: 'Free Node - 4',
  sftp_details: { ip: 'node4.vertexnodes.com', port: 1234 },
  description: '',
  limits: {
    memory: 150,
    swap: 0,
    disk: 512,
    io: 500,
    cpu: 17,
    threads: null,
    oom_disabled: true
  },
  invocation: 'if [[ ! -z ${GIT_URL} ]] && [[ -d .git ]]; then git pull ${GIT_URL}; elif [[ ! -z ${GIT_URL} ]] && [[ ! -d .git ]]; then git init && git pull ${GIT_URL}; fi; if [ -f /home/container/package.json ]; then /usr/local/bin/npm install --production; fi;/usr/local/bin/node /home/container/index.js',
  docker_image: 'quay.io/parkervcp/pterodactyl-images:debian_nodejs-16',
  egg_features: null,
  feature_limits: { databases: 0, allocations: 0, backups: 0 },
  status: null,
  is_suspended: false,
  is_installing: false,
  is_transferring: false,
  relationships: {
    allocations: { object: 'list', data: [Array] },
    variables: { object: 'list', data: [Array] }
  }
}

setPowerState

Set the Powerstate of the server. State can be start, stop, kill or restart.

Parameters: ServerID, Powerstate

const VertexNodes = require("vertexnodes-js");
const host = new VertexNodes("API KEY");

host.setPowerState("server ID", "start").then(() => {
   console.log("Successfully set powerstate to start");
}).catch(err => console.log(err));

Returns a true boolean expression if changing powerstate was successful.

getPowerState

Get the Powerstate of the server.

Parameters: ServerID

const VertexNodes = require("vertexnodes-js");
const host = new VertexNodes("API KEY");

host.getPowerState("server ID").then(state => {
   console.log(state);
}).catch(err => console.log(err));

Returns the state of the server.

sendCommand

Sends a command to the server. The server must be online to send a command to it.

Parameters: ServerID, Command

const VertexNodes = require("vertexnodes-js");
const host = new VertexNodes("API KEY");

host.sendCommand("server ID", "say hello").then(() => {
   console.log("Sucesfully send the command");
}).catch(err => console.log(err));

Returns a true boolean expression if sending the command was successful.

LICENSE