Talk to hardware. From JavaScript and Rust.
A cross-platform serial-port toolkit. Linux · macOS · Windows.
SerialPilot is a modern, batteries-included toolkit for talking to serial devices — Arduinos, GPS modules, modems, industrial PLCs, RFID readers, point-of-sale hardware, anything that speaks UART. Native bindings under the hood, ergonomic streams and parsers on top, fully typed end-to-end, and a sibling Rust crate for everywhere Node can't go.
If you've ever fought node-serialport quirks or written the same reconnect-loop and command-queue code for the third time, this is for you.
npm install serialpilotimport { SerialPilot, ReadlineParser } from 'serialpilot'
const port = new SerialPilot({ path: '/dev/ttyUSB0', baudRate: 115200 })
const lines = port.pipe(new ReadlineParser({ delimiter: '\n' }))
lines.on('data', line => console.log('←', line))
port.write('PING\n')Need auto-reconnect, request/response queues, or one of 11 protocol parsers? Each lives in its own package — pick what you need.
| Package | What it does |
|---|---|
serialpilot |
The umbrella package with sensible defaults — start here. |
| Package | What it does |
|---|---|
@serialpilot/bindings-cpp |
Native C++/NAPI bindings for Linux, macOS, Windows. |
@serialpilot/bindings-interface |
TypeScript interface for authoring custom bindings. |
@serialpilot/binding-mock |
In-memory mock binding for testing. |
serialpilot-rust |
Standalone, pure-Rust serial port crate. Built with cargo. |
| Package | What it does |
|---|---|
@serialpilot/stream |
Node.js Duplex Stream interface over a binding. |
| Package | What it does |
|---|---|
@serialpilot/reconnect |
Drop-in auto-reconnect wrapper for resilient connections. |
@serialpilot/command-queue |
Request/response queue for AT commands, Modbus RTU, and similar protocols. |
| Package | What it does |
|---|---|
@serialpilot/parser-byte-length |
Emit fixed-length chunks. |
@serialpilot/parser-cctalk |
ccTalk coin/note acceptor protocol. |
@serialpilot/parser-delimiter |
Split on a custom delimiter. |
@serialpilot/parser-inter-byte-timeout |
Emit when the line goes quiet. |
@serialpilot/parser-packet-length |
Length-prefixed framed packets. |
@serialpilot/parser-readline |
Newline-terminated text — the most common parser. |
@serialpilot/parser-ready |
Wait for a "ready" sentinel before emitting downstream. |
@serialpilot/parser-regex |
Split using a regular expression. |
@serialpilot/parser-slip-encoder |
RFC 1055 SLIP framing. |
@serialpilot/parser-spacepacket |
CCSDS Space Packet protocol. |
@serialpilot/parser-start-end |
Frame on start/end byte sequences. |
| Package | Binary | What it does |
|---|---|---|
@serialpilot/list |
serialpilot-list |
Enumerate ports on this machine. |
@serialpilot/terminal |
serialpilot-terminal |
Interactive serial console. |
@serialpilot/repl |
serialpilot-repl |
Scriptable Node REPL bound to a port. |
Hands-on guides under docs/recipes/:
- Arduino — read sensor data, write commands.
- Modbus RTU — talk to industrial hardware.
- Electron — bundle SerialPilot in a desktop app.
- Docker — pass
/dev/tty*into containers. - Error handling — typed errors, structured retries.
- Reconnect — survive cable yanks and device resets.
- Typed end-to-end. Every package ships hand-written TypeScript declarations. No
@types/...chase. - Modular. Use the umbrella
serialpilotfor defaults, or pick exactly the binding + parser + helper you want. - Testable. First-class
binding-mockmeans your tests don't need a USB device on the CI runner. - Polyglot. A pure-Rust crate (
serialpilot-rust) for embedded, CLI, and systems-programming use cases where Node isn't an option. - CI on every push — Linux, macOS, Windows.
- MIT — use it anywhere.
| Channel | Use it for |
|---|---|
| Discussions | Questions, design proposals, "show & tell". |
| Issues | Reproducible bugs and concrete feature requests. |
| Contributing guide | How to send a PR. |
| Security policy | Report a vulnerability privately. |
| Code of conduct | The community ground rules. |
Built and maintained by Ritesh Rana — contact@riteshrana.engineer.
If SerialPilot saves you a weekend, consider buying me a coffee ☕.
All SerialPilot projects are released under the MIT License.