npm i dathost-rcon-client
import { Rcon } from "dathost-rcon-client";
const client = new Rcon({
// all of those are required!
port: 25575,
host: "localhost",
password: "test",
});
try {
await client.connect();
const response = await client.send("status");
console.log(response);
} catch (e) {
console.log(`Got error ${e}`);
} finally {
client.disconnect();
}