rcon-ts-valve
v1.0.3
Published
Improved RCON client in typescript
Readme
rcon-ts-valve
This package is a simple rcon client written in typescript.
This package is based on the rcon-ts package, add the feature that support Multiple-packet Responses.
Multiple-packet Responses support is under the guide of Valve's Source RCON Protocol.
Why use rcon-ts-valve?
After searching for a rcon client for node.js expecially for TypeScript, I found that every packages either didn't work or didn't have the features I needed(especially when server need to send data that is more than 4096 bytes).
And this package is very slim and easy to use which can reduce the load on your server when building web panels using this package.
Installation
npm install rcon-ts-valveBasic Usage
import Rcon from 'rcon-ts-valve'
(async () => {
const rcon = new Rcon({
host: "127.0.0.1",
port: 27555,
password: "password",
});
try {
// initial connection
await rcon.connect();
// Basic usage
const response = await rcon.send('Command0');
console.log(response);
// Sequential usage
const responseList = await rcon.sequentialSend(["Command1", "Command2", "Command3", "..."]);
console.log(responseList);
}catch (e) {
console.log("Error", e);
}finally {
rcon.disconnect();
}
})()