# s2serial

> Streams2 frontend for node-serialport

Latest version **0.1.1** (published 2013-07-22) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2013-07-22 |
| First published | 2013-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Michael Harsch |
| Maintainers | mharsch |
| Keywords | serialport, serial |

## Links

- npm: https://www.npmjs.com/package/s2serial
- Repository: https://github.com/mharsch/node-s2serial
- Issues: https://github.com/mharsch/node-s2serial/issues
- npm.io page: https://npm.io/package/s2serial

## Dependencies (1)

- [serialport](https://npm.io/package/serialport.md) >=1.1.1

## Recent versions

- 0.1.1 (latest) — 2013-07-22
- 0.1.0 — 2013-07-22
- 0.0.1 — 2013-07-19

## README

#s2serial

A Streams2 frontend for
[node-serialport](https://github.com/voodootikigod/node-serialport).

##Usage:

The S2Serial implements the same API as node-serialport except: 

* The `parser` option is ignored (forcing `raw` mode)
* The returned object implements a 
[Duplex Stream](http://nodejs.org/api/stream.html#stream_class_stream_duplex)


##Example:

	var S2Serial = require('s2serial').S2Serial;
	var sp = new S2Serial('/dev/tty.usb411', {baudrate: 57600});

	// hypothetical Streams that implement some protocol
	var encoder = new MyEncoder(); // encodes command objs into bytes
	var decoder = new MyDecoder(); // parses stream of bytes and emits objs

	sp.pipe(decoder);
	decoder.on('message', function (msg) {
		console.log('message received from serialport: ' + msg);
	});

	sp.on('open', function () {
		encoder.pipe(sp);
		encoder.send({ cmd: 'getsomething' });
	});

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