# sr201

> NodeJS SR-201 Network Relay control

Latest version **0.2.1** (published 2018-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install sr201
pnpm add sr201
yarn add sr201
bun add sr201
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-10-04 |
| First published | 2018-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Diogo Resende |
| Maintainers | dresende |

## Links

- npm: https://www.npmjs.com/package/sr201
- Repository: https://github.com/dresende/node-sr201
- Homepage: https://github.com/dresende/node-sr201#readme
- Issues: https://github.com/dresende/node-sr201/issues
- npm.io page: https://npm.io/package/sr201

## Recent versions

- 0.2.1 (latest) — 2018-10-04
- 0.2.0 — 2018-10-04
- 0.1.0 — 2018-10-03

## README

## SR-201 Network Relay

NodeJS SR-201 network relay protocol.

### Install

```sh
npm i sr201
```

### Usage

```js
const sr201 = require("sr201");

sr201.connect("192.168.1.100", 6722).then(async (client) => {
	await client.on(2);
	await client.delay(2000);
	await client.off(2);
	console.log(client.status(2));
	await client.end();
}, (err) => {
	console.log(err);
});
```

### Reconfigure

```js
const sr201 = require("sr201");

sr201.connect("192.168.1.100", 6722).then(async (client) => {
	await client.reconfigure(
		"192.168.10.123", // ip
		"255.255.255.0",  // mask
		"192.168.10.1",   // gateway
		"192.168.10.1",   // dns
	);
	// in the end, settings are saved and device restarts
}, (err) => {
	console.log(err);
});
```

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