modern-rcon
A modern RCON client implementation written in ES2015
Last updated 3 years ago by levrik .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install modern-rcon 
SYNC missed versions from official npm registry.

node-modern-rcon npm package

A modern RCON client implementation written in ES2015

NOTE: This has only been tested with Minecraft. So be aware of possible bugs with other server implementations. Feel free to submit a PR if you have any problems.

Installation

npm install modern-rcon --save

API

new Rcon(host, port = 25575, password, timeout = 5000)

Creates a new Rcon object.

rcon.connect() -> Promise

Connects with the credentials provided in the constructor.

rcon.send(data) -> Promise<string>

Executes the provided command on the open connection and returns the response.

rcon.disconnect() -> Promise

Disconnects gracefully.

Example

const Rcon = require('modern-rcon');

const rcon = new Rcon('localhost', 'some password');

rcon.connect().then(() => {
  return rcon.send('help'); // That's a command for Minecraft
}).then(res => {
  console.log(res);
}).then(() => {
  return rcon.disconnect();
});

Contribute

  1. Install the dependencies with npm install
  2. Setup a Minecraft Server for the tests by using npm run setup-minecraft
    Important: This script will automatically accept the Minecraft EULA

To run the tests you need to start the Minecraft Server with npm run start-minecraft in another Terminal.

License

MIT

Current Tags

  • 1.0.3                                ...           latest (3 years ago)

4 Versions

  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (0)
None
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |