Skip to content
@serialpilot

serialpilot

SerialPilot

SerialPilot

Talk to hardware. From JavaScript and Rust.

A cross-platform serial-port toolkit. Linux · macOS · Windows.

Main repo Latest release Build npm Node.js Rust TypeScript License


👋 Welcome

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.

⚡ Quick start

npm install serialpilot
import { 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.

📦 What's inside

Core

Package What it does
serialpilot The umbrella package with sensible defaults — start here.

Bindings — the layer that touches the OS

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.

Interfaces

Package What it does
@serialpilot/stream Node.js Duplex Stream interface over a binding.

High-level helpers

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.

Parsers — turn raw bytes into messages

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.

CLI tools

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.

🍳 Recipes

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.

🎯 Why SerialPilot

  • Typed end-to-end. Every package ships hand-written TypeScript declarations. No @types/... chase.
  • Modular. Use the umbrella serialpilot for defaults, or pick exactly the binding + parser + helper you want.
  • Testable. First-class binding-mock means 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.

🤝 Get involved

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.

👤 Maintainer

Built and maintained by Ritesh Ranacontact@riteshrana.engineer.

If SerialPilot saves you a weekend, consider buying me a coffee ☕.

📄 License

All SerialPilot projects are released under the MIT License.

Popular repositories Loading

  1. serialpilot serialpilot Public

    Cross-platform serial port toolkit for Node.js and Rust — bindings, parsers, REPL, terminal, and reconnect/queue helpers.

    TypeScript

  2. .github .github Public

  3. serialpilot-protocols serialpilot-protocols Public

    This is the missing middle layer for the SerialPilot org: a small set of pure-function protocol codecs (no I/O, no native deps, Uint8Array-only) plus their Transform-stream parser counterparts.

    TypeScript

  4. serialpilot-drivers serialpilot-drivers Public

    Higher-level device drivers built on SerialPilot.

    TypeScript

Repositories

Showing 4 of 4 repositories

Top languages

Loading…

Most used topics

Loading…