# @juanjofp/serialport-observable

> Serialport-observable is a library for RxJS that allows you to read and write data from/to a serial port.

Latest version **0.0.25** (published 2023-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @juanjofp/serialport-observable
pnpm add @juanjofp/serialport-observable
yarn add @juanjofp/serialport-observable
bun add @juanjofp/serialport-observable
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.25 |
| Published | 2023-06-20 |
| First published | 2022-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 26.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | juanjofp, francescorivola |
| Maintainers | juanjofp |

## Links

- npm: https://www.npmjs.com/package/@juanjofp/serialport-observable
- Repository: https://github.com/Juanjofp/-serialport-observable
- Homepage: https://github.com/Juanjofp/-serialport-observable#readme
- Issues: https://github.com/Juanjofp/-serialport-observable/issues
- npm.io page: https://npm.io/package/@juanjofp/serialport-observable

## Dependencies (3)

- [rxjs](https://npm.io/package/rxjs.md) ^7.8.1
- [serialport](https://npm.io/package/serialport.md) ^11.0.0
- [@serialport/parser-readline](https://npm.io/package/@serialport/parser-readline.md) ^11.0.0

## Recent versions

- 0.0.25 (latest) — 2023-06-20
- 0.0.24 — 2023-04-15
- 0.0.23 — 2023-04-15
- 0.0.21 — 2023-04-15
- 0.0.20 — 2023-04-14
- 0.0.19 — 2022-11-02
- 0.0.18 — 2022-09-15
- 0.0.17 — 2022-09-06
- 0.0.16 — 2022-08-30
- 0.0.15 — 2022-08-12
- 0.0.14 — 2022-07-28
- 0.0.13 — 2022-07-17
- 0.0.12 — 2022-07-08
- 0.0.11 — 2022-07-05
- 0.0.10 — 2022-06-29
- … 8 more at https://npm.io/package/@juanjofp/serialport-observable/versions

## README

[![Publish package in npm](https://github.com/Juanjofp/-serialport-observable/actions/workflows/npm.yml/badge.svg)](https://github.com/Juanjofp/-serialport-observable/actions/workflows/npm.yml)

# Serialport Observable

Serialport-observable is a library for RxJS that allows you to read and write data from/to a serial port.

# install

```js
npm install @juanjofp/serialport-observable
```

# Usage

```ts
const uartDevice = createSerialPortObservable('/dev/ttyAMA0', {
    baudRate: 9600,
    highWaterMark: 100000
});

await uartDevice.open();

let subscription: Subscription | undefined;
const obsValue = await new Promise<Buffer>(resolve => {
    subscription = uartDevice.data().subscribe(resolve);
    uartDevice.write([0x01, 0x02, 0x03]);
});

subscription?.unsubscribe();
await uartDevice.close();

expect(uartDevice.isConnected()).toBe(false);
expect(obsValue.byteLength).toBeGreaterThanOrEqual(1);
```

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