# source-rcon-lib

> A simple [Node.js](https://nodejs.org/en/) library for the [Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)

Latest version **1.0.3** (published 2020-03-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install source-rcon-lib
pnpm add source-rcon-lib
yarn add source-rcon-lib
bun add source-rcon-lib
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-03-19 |
| First published | 2020-02-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nick Brandt |
| Maintainers | brandtnick |
| Keywords | rcon, source, protocol, srcds, remote console, valve, steam |

## Links

- npm: https://www.npmjs.com/package/source-rcon-lib
- Repository: https://github.com/BrandtNick/source-rcon-lib
- Homepage: https://github.com/BrandtNick/source-rcon-lib#readme
- Issues: https://github.com/BrandtNick/source-rcon-lib/issues
- npm.io page: https://npm.io/package/source-rcon-lib

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-03-19
- 1.0.2 — 2020-02-29
- 1.0.1 — 2020-02-28
- 1.0.0 — 2020-02-28

## README

# Source RCON library

A simple [Node.js](https://nodejs.org/en/) library for the [Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)

## Installation

```shell script
yarn add source-rcon-lib
```

## Usage
This is a promise-based library.

#### Examples

Establishing a connection:
```js
const {connect} = require('source-rcon-lib');

// these values are default
connect('127.0.0.1', '27020', '')
  .then(() => console.log('connected'))
  .catch(err => console.error(err));
```

Sending a command to list all players in server:
```js
const {send} = require('source-rcon-lib');

send('listplayers')
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

Disconnecting from RCON server:
```js
const {disconnect} = require('source-rcon-lib');

disconnect()
  .then(() => console.log('disconnected'))
  .catch(err => console.error(err));
```

#### API
| Function | Arguments | Returns |
| -------- | -------- | ------- |
| connect | url _(string)_, port _(string)_, password _(string)_ | Promise |
| send | command _(string)_ | Promise |
| disconnect | _none_ | Promise |


## Upcoming

- tests

---
_Source: https://npm.io/package/source-rcon-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
