finds.dev← search

// the find

yaacov/node-modbus-serial

★ 732 · JavaScript · ISC · updated Oct 2026

A pure JavaScript implemetation of MODBUS-RTU (and TCP) for NodeJS

A pure JavaScript Modbus library for Node that works as both client and server across RTU over serial, ASCII, TCP, UDP, Telnet, and TCP-wrapped RTU bridges. It suits anyone connecting a Node service to PLCs, irrigation controllers, or Arduino-based Modbus slaves over RS485 or RS232.

- One client class covers the transport matrix: buffered and unbuffered RTU, ASCII, TCP, UDP for C701 bridges, Telnet, and TCP-wrapped RTU. Moving a device from a serial line to a bridge is a change to the connect call, not a rewrite.

- serialport is an optional dependency, so TCP-only deployments install without a native build. The README also states which serial APIs fail at runtime when serialport is missing.

- It implements less common function codes, including FC22 mask write and FC43/14 device identification. The ServerTCP handlers accept synchronous return values, callbacks, or promises for the same operation.

- Per-port tests run against mocked serial, net, and dgram layers, and a CI workflow is included. Protocol changes can be exercised without a bench device.

- Callbacks and promises are mixed across the examples with no stated preferred style. The logger examples ignore err in their callbacks, and the README never says which style the maintainer expects for new code.

- The method reference lives on an external wiki, so the in-repo documentation is a feature table plus examples. The generated JSDoc HTML is gitignored, so there is no version-matched API reference in the repo itself.

- Parts of the README are out of date or inconsistent. The Node compatibility note cites 4.x, 6.x, and 8.x as examples, the modbusdb example uses connectTcpRTUBuffered while the rest uses connectTCP and connectRTUBuffered, and the install advice still recommends --unsafe-perm --build-from-source.

- Serial support carries the native serialport build burden. The serialport 13 range requires Node 20 or newer, so anyone on an older LTS has to pin serialport 12 by hand and verify that combination themselves.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →