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
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.jsExample 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
messageto all players. The optionalcallbackwill be called after the message is sent.sb.listUsers(callback)function callback(message)message.usersis an array of{clientId, username, uuid}objects.
sb.sendCommand(command, callback)For forward compatibility, sends
commandto the server.function callback(message)message.bodycontains the response from the server.