JSPM

rconify

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q23476F
  • License MIT

Utilize the RCON Protocol in your NodeJS program

Package Exports

  • rconify
  • rconify/dist/index.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 (rconify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rconify

Connect and interact with any Source-compliant server using the Valve RCON Specification

Usage

import {RconClient} from 'rconify'

Example

import {RconClient} from 'rconify'

(async() => {
    // Initialize the client
    const client = new RconClient({
        host: "1.2.3.4", // the IP address to your server
        port: 1234, // RCON server port
        password: "bestpasswordevermade" // RCON server password
    })

    // Connect to the server
    // throws if;
    // - server is not avaliable
    // - password is incorrect
    await client.connect()

    // Send a command
    // Example is using a Minecraft RCON server
    let response = await client.sendCommand("time set day")
    console.log(response) // "Set the time to 1000"

    // Disconnect using the .disconnect() function
    client.disconnect()
})()