JSPM

starbound.js

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q40707F
  • License MIT

A Starbound RCON client.

Package Exports

  • starbound.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (starbound.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

license npm version npm downloads

starbound.js

A Starbound RCON client

This client is fairly barebones at the moment as it's under active development. However, some basic functionality is working...

Install

Install via npm:

npm install --save starbound.js

Example Code

Here's some sample code to get you started...

var Starbound = require('starbound.js');

var sb = new Starbound(host, port);
sb.connect('password', function(successful) {
  sb.listUsers(function(message) {
    message.users.forEach(function(info) {
      console.log(info.clientId, info.username, info.uuid);
    });
  });
});

Supported Commands

The following commands are supported:

  • sb.broadcast(message, callback)

    Broadcasts message to all players. The optional callback will be called after the message is sent.

  • sb.listUsers(callback)

    function callback(message)

    • message.users is an array of {clientId, username, uuid} objects.
  • sb.sendCommand(command, callback)

    For forward compatibility, sends command to the server. function callback(message)

    • message.body contains the response from the server.