SerialPilot

/02 — Reference

Package matrix

Twenty-one published packages, all version 1.0.0, all under the @serialpilot scope (with the exception of the meta package, which is just serialpilot). Install the meta package for the common case; cherry-pick when bundle size matters.

Meta

PackageWhat it doesDepends on
serialpilot Auto-detected bindings, the stream wrapper, every parser re-exported. Most projects only need this one. everything below

Bindings

PackageWhat it does
@serialpilot/bindings-cpp Native N-API bindings. Ships with prebuilds for the common (OS, arch, Node) triples; falls back to a source build if none match.
@serialpilot/bindings-interface The TypeScript interface every binding implements. Import this if you're writing your own backend (a virtual port, a TCP-bridged port, a CI mock).
@serialpilot/binding-mock In-memory binding for tests. Echo, record, periodic data, programmable responders. See Mocking.

A pure-Rust binding ships in the same monorepo as a Cargo crate at crates/bindings-rust. It's not on npm because it isn't a JavaScript package — use it from Rust projects directly.

Interfaces

PackageWhat it does
@serialpilot/stream The Node.js Duplex stream wrapper that SerialPilot extends. Re-export it directly if you want a different binding without the parser bundle.

High-level helpers

PackageWhat it does
@serialpilot/reconnect Auto-reconnect wrapper with exponential backoff and device-filter rediscovery. See the recipe.
@serialpilot/command-queue Request/response over half-duplex links — AT commands, Modbus RTU, ccTalk. Per-command timeout, retry, regex match. See the Modbus recipe.

CLI

PackageBinaryPurpose
@serialpilot/listserialpilot-listEnumerate ports.
@serialpilot/terminalserialpilot-terminalInteractive console.
@serialpilot/replserialpilot-replScriptable Node REPL.

Parsers

PackageClassFor
parser-byte-lengthByteLengthParserFixed-size frames.
parser-cctalkCCTalkParserCoin/bill validators.
parser-delimiterDelimiterParserSplit on byte sequence.
parser-inter-byte-timeoutInterByteTimeoutParserQuiescence-based framing.
parser-packet-lengthPacketLengthParserLength-prefixed packets.
parser-readlineReadlineParserLine-by-line text.
parser-readyReadyParserWait for sentinel.
parser-regexRegexParserSplit on a pattern.
parser-slip-encoderSlipEncoder / SlipDecoderRFC 1055 SLIP framing.
parser-spacepacketSpacePacketParserCCSDS Space Packet.
parser-start-endStartEndParserSTX/ETX-style frames.

Drivers

Higher-level device drivers live in the serialpilot-drivers monorepo. Each driver is a standalone npm package that takes a Transport (usually a SerialPilot instance) and emits typed events or provides a request/response API.

PackageProtocolWhat it does
@serialpilot/driver-kitShared building blocks: Device base class, Transport interface, MockTransport, RequestQueue, LineBuffer, createLogger.
@serialpilot/driver-gpsNMEA 0183GPS receiver — GGA/RMC/GSA/GSV, typed Fix events.
@serialpilot/driver-grblGRBL 1.1CNC controller — typed status, command-queued G-code, real-time control.
@serialpilot/driver-esp-flasherESP ROMESP32/ESP8266 ROM-bootloader flasher — SLIP framing, chip detect, flash with progress.
@serialpilot/driver-atAT commandsGeneric AT-command framework — cellular/LoRa/WiFi-via-AT modems.
@serialpilot/driver-modbus-rtuModbus RTUIndustrial automation — read/write holding/input registers, CRC-16, typed errors.
@serialpilot/driver-plantowerPlantower PMPMS5003/PMS1003/PMS3003 particulate matter sensor — active-mode readings with checksum validation.

How the layers fit

┌─────────────────────────────────────────────────────┐
│  Drivers (GPS, GRBL, ESP, AT, Modbus, Plantower)    │
│  ↑ each takes a Transport, emits typed events       │
└─────────────────────────────────────────────────────┘
         │
┌────────▼────────────────────────────────────────────┐
│  serialpilot      (meta — re-exports everything)    │
└─────────────────────────────────────────────────────┘
│            │             │
┌────▼────┐  ┌────▼────┐   ┌────▼────────────┐
│ stream  │  │ parsers │   │ helpers         │
│ Duplex  │  │ × 11    │   │ reconnect       │
│ wrapper │  │         │   │ command-queue   │
└────┬────┘  └─────────┘   └─────────────────┘
│
┌────▼─────────────────────────┐
│ bindings-interface           │
│  ↑ implemented by ↑          │
│ bindings-cpp · binding-mock  │
└──────────────────────────────┘

Versioning

All @serialpilot/* packages are released in lock-step. A 1.x release of the meta package always pins exact 1.x versions of its dependencies — there is no scenario where you should mix-and-match minor versions across the scope.

Pick the smallest set

If you're worried about install size or cold-start time:

  • Just opening a port and reading raw bytes? @serialpilot/bindings-cpp + @serialpilot/stream.
  • Plus line-oriented protocols? Add @serialpilot/parser-readline.
  • Need the mock for tests but only in dev? npm i -D @serialpilot/binding-mock.
  • Production resilience? @serialpilot/reconnect.
  • Talking to a specific protocol? Install the relevant driver from serialpilot-drivers — e.g. @serialpilot/driver-modbus-rtu for industrial equipment, or @serialpilot/driver-gps for GPS receivers.

Edit this page on GitHub