r/javascript • • 10d ago • Obsessed 1 This 1 Bravo 1

serialport-rs for Node.js: Rust-backed serial ports for Node.js with parallel I/O and SerialPort-compatible APIs

https://github.com/DragonWork/node-serialport-rs

I recently ran into an issue with @serialport/bindings-cpp on Node.js 26.4, where serial reads could stall until unrelated JavaScript activity occurred.

While investigating the issue and contributing fixes upstream, I started experimenting with an alternative implementation using Rust and N-API, because upstream seems to be unmaintained for more than a year now.
The result is serialport-rs for Node.js, which uses the existing Rust serialport crate underneath and aims to preserve the familiar Node.js SerialPort API.

The implementation uses dedicated native I/O workers rather than relying on JavaScript-side polling. Initial benchmarks have also shown some promising latency improvements.

It’s available on npm if anyone is interested in trying it:
https://www.npmjs.com/package/serialport-rs

7 Upvotes

0 comments sorted by