Package Exports
- arcon.js
- arcon.js/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 (arcon.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ARCON.js

ARCON.js is a lightweight, event-based RCON client for Arma III servers designed to be reliable and easy to use.
Installation
ARCON.js can be installed via npm using npm install arcon.js
Usage
An RCON connection can be established by instantiating the Arcon class and calling the connect function.
Arcon constructor properties
| Property | Description | type | required | default |
|---|---|---|---|---|
| host | The hostname/IP of the RCON server. | string | true | |
| port | The port of the RCON server. | number | true | |
| password | The password of the RCON server. | string | true | |
| autoReconnect | Whether to automatically reconnect on disconnects. Excludes incorrect password. | bool | false | true |
| playerUpdateInterval | Time (in ms) between sending a players command to the server. |
number | false | 5000 |
import { Arcon } from 'arcon.js';
const connection = new Arcon({
host: '127.0.0.1',
port: 2312,
password: '12345',
});
connection.connect();Events
Being an event-based library, there are multiple events that you can subscribe to. A list of all events can be found here.
Note that if you do not add a listener to the error event, your application will crash if an error is ever created.
import { Arcon, Player, BeLog } from 'arcon.js';
const connection = new Arcon({
host: '127.0.0.1',
port: 2312,
password: '12345',
});
connection.on('connected', () => {
console.log('Connected!');
});
connection.on('disconnected', () => {
console.log('Disconnected!');
});
connection.on('error', (error: Error) => {
console.error(error);
});
connection.on('beError', (error: Error) => {
console.error(error);
});
connection.on('players', (players: Player[]) => {
console.log(players);
});
connection.on('playerConnected', (player: Player) => {
console.log(player);
});
connection.on('playerDisconnected', (player: Player, reason: string) => {
// If a player disconnects by themself, reason is "disconnected".
// Otherwise it will be parsed from text.
console.log(player, reason);
});
connection.on(
'playerUpdated',
(player: Player, [pingUpdate, verifiedUpdate, lobbyUpdate]: [boolean, boolean, boolean]) => {
if (pingUpdate) console.log(player.ping);
},
);
connection.on('beLog', (log: BeLog) => {
console.log(log);
});
connection.on('playerMessage', (player: Player, channel: string, message: string) => {
console.log(`(${channel}) ${player.name}: ${message}`);
});
connection.on('adminMessage', (id: number, channel: string, message: string) => {
console.log(id, channel, message);
});
connection.on('console', (data: String) => {
console.log(data);
});
connection.connect();