# sxapi-telnet-client

> API library for silixcon's socket server.

Latest version **0.1.7** (published 2022-05-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install sxapi-telnet-client
pnpm add sxapi-telnet-client
yarn add sxapi-telnet-client
bun add sxapi-telnet-client
```

## 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.1.7 |
| Published | 2022-05-14 |
| First published | 2022-04-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eric Valcik |
| Maintainers | ericvalcik |
| Keywords | silixcon, sxapi |

## Links

- npm: https://www.npmjs.com/package/sxapi-telnet-client
- Repository: https://github.com/valcikeric/sxapi-telnet-client
- Homepage: https://github.com/valcikeric/sxapi-telnet-client#readme
- Issues: https://github.com/valcikeric/sxapi-telnet-client/issues
- npm.io page: https://npm.io/package/sxapi-telnet-client

## Dependencies (3)

- [ts-node](https://npm.io/package/ts-node.md) ^10.7.0
- [typescript](https://npm.io/package/typescript.md) ^4.6.3
- [telnet-client](https://npm.io/package/telnet-client.md) ^2.0.2

## Recent versions

- 0.1.7 (latest) — 2022-05-14
- 0.1.6 — 2022-05-14
- 0.1.5 — 2022-05-14
- 0.1.3 — 2022-05-13
- 0.1.2 — 2022-04-29
- 0.1.1 — 2022-04-29
- 0.1.0 — 2022-04-23

## README

# sxapi-telnet-client

This library is just a client for communication with siliXcon's socket server, such server can be created with our [SWTools](https://drive.google.com/drive/folders/1UyIg-EUufEwdt14pjJqswG2xqxYfuM_0?usp=sharing). If EMGui is running, then the server is active (make sure you have the latest version of SWTools).

Install with:

```bash
npm i sxapi-telnet-client
```

### Example

```typescript
import { Sxapi } from "sxapi-telnet-client";


const fun = async () => {
    const sxapi = new Sxapi();
    await sxapi.init();

    await sxapi.search();

    const node = await sxapi.node(1);

    console.log(node);

    const node_id = node.handle

    const iref = await sxapi.get(node_id, '/driver/iref');

    console.log(iref);
}

fun();
```

## Methods

### `async sxapi.search(): number`

This method searches for all connected controllers (only on the currently selected interface, right now you **cannot** change interfaces with this client), and returns the number of all connected controllers.

### `async sxapi.node(address: number): Promise<Node>`

This returns metadata of the selected connected. Address is a integer number from `0` to `6` (for more visit our [documentation](https://silixcon2.atlassian.net/servicedesk/customer/portal/3/article/295747)).

### `async sxapi.allNodes(): Promise<Node[]>`

Same as `sxapi.node`, but returns all connected controllers in an array.

### `async sxapi.get(nodeId: string, path: string): Promise<string>`

### `async sxapi.set(nodeId: string, path: string, val: string)`

### `async sxapi.exec(nodeId: string, commnand: string, args: nullableString = null)`

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