npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sa-simple-rcon

v1.1.9-dev26

Published

> A simplified rcon client for rust and ark

Downloads

856

Readme

RconClient

Overview

RconClient is a flexible remote console client that supports multiple connection types (WebSocket and NetSocket) for game server management. It leverages event-driven architecture to handle RCON commands and responses efficiently.

Features

  • Supports both WebSocket and TCP connections.
  • Event-driven approach for robust and scalable server command handling.
  • Easy to integrate with various game servers by configuring the gameId.

Installation

To install RconClient, run the following npm command:

npm install sa-simple-rcon

For more details, visit the npm package page.

Usage

Creating an Instance

Instantiate RconClient by providing a configuration object which includes gameId and other connection-specific options.

import { RconClient } from 'sa-simple-rcon';

const options = {
  host: 'localhost',
  port: 25575,
  password: 'your_password',
  timeout: 5000,
  gameId: 252490 // Use 346110 for ARK
};

const rcon = new RconClient(options);

Connecting to the Server

rcon.login();

Sending Commands

rcon.send('status', 'ServerStatus', 1);

Handling Responses

RconClient inherits from EventEmitter, allowing you to listen to various events.

rcon.on('message', (data) => {
  console.log('Received:', data);
});

Closing Connection

rcon.close(); // Gracefully closes the connection

API

login()

Initiates the connection based on the provided options.

send(message: string, name: string, identifier: string | number)

Sends a message/command to the server. name and identifier can be used to handle responses.

close()

Closes the connection gracefully.

terminate()

Forcibly closes the connection.