Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Node.js
  3. modbus-serial

modbus-serial

ISCJavaScriptv8.0.25

A pure JavaScript implementation of MODBUS-RTU (Serial and TCP) for Node.js to communicate with industrial devices.

GitHubGitHub
731 stars268 forks0 contributors

What is modbus-serial?

modbus-serial is a Node.js library that implements the MODBUS-RTU and MODBUS-TCP protocols in pure JavaScript. It allows developers to communicate with industrial electronic devices, such as PLCs, irrigation controllers, and robots, over serial lines (e.g., RS485, RS232) or TCP/IP networks. The library supports standard MODBUS function codes for reading and writing data to devices, making it a versatile tool for industrial automation and IoT projects.

Target Audience

Developers and engineers working on industrial automation, IoT, or robotics projects that require communication with MODBUS-enabled devices. It is particularly useful for Node.js developers integrating with PLCs, Arduino-based systems, or other industrial equipment.

Value Proposition

Developers choose modbus-serial because it is a pure JavaScript implementation with no native dependencies for TCP/UDP usage, making it easy to install and deploy. It supports multiple transport protocols (serial, TCP, UDP, Telnet) and includes both client and server modes, offering flexibility for various industrial communication scenarios.

Overview

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

Use Cases

Best For

  • Communicating with industrial PLCs and controllers over serial RS485/RS232
  • Building IoT gateways that bridge MODBUS devices to Node.js applications
  • Creating MODBUS-TCP servers for simulating or testing industrial equipment
  • Integrating Arduino-based MODBUS slaves into Node.js automation systems
  • Logging data from multiple MODBUS slaves (e.g., meters, sensors) in real-time
  • Developing irrigation control systems or robotics with MODBUS protocol support

Not Ideal For

  • Projects requiring high-speed, real-time MODBUS communication with minimal latency, as the pure JavaScript implementation may introduce performance overhead.
  • Systems constrained to older Node.js versions (below 20) that need serial support, due to dependency conflicts with serialport 13.x.
  • Applications needing robust MODBUS server functionality over serial lines, as server support is primarily focused on TCP with limited serial server options.
  • Developers who prefer batteries-included libraries with no optional dependencies, as serialport setup can be cumbersome and error-prone.

Pros & Cons

Pros

Pure JavaScript Core

Implements MODBUS protocols without native dependencies for TCP/UDP, enabling easier deployment in environments where serial hardware isn't needed, as highlighted by the optional serialport dependency.

Comprehensive Protocol Support

Supports MODBUS-RTU, MODBUS-TCP, UDP, Telnet, and ASCII, covering a wide range of industrial communication scenarios, as evidenced by the multiple port classes and examples in the README.

Client and Server Modes

Includes both client classes for querying devices and a ServerTCP class for creating MODBUS-TCP servers, offering flexibility for testing and simulation, with detailed vector-based examples provided.

Full Function Code Implementation

Implements standard MODBUS function codes (FC1-FC16, FC22, FC43/14), allowing complete read/write operations on coils, registers, and device identification, as listed in the compatibility table.

Cons

Serial Dependency Complexity

The optional serialport dependency can cause installation headaches, requiring specific npm flags or manual installation, and serial-specific APIs fail at runtime if not properly set up, as warned in the README.

Limited Serial Server Support

Server functionality is primarily for TCP; serial server support is less documented or might be incomplete, limiting its use for serial-based master devices compared to the robust TCP server examples.

Performance Overhead

As a pure JavaScript library, it may not match the performance of native C++ bindings for high-frequency data polling or latency-sensitive applications, which could be a bottleneck in industrial automation.

Frequently Asked Questions

Quick Stats

Stars731
Forks268
Contributors0
Open Issues117
Last commit10 days ago
CreatedSince 2015

Tags

#industrial-automation#iot#modbus-rtu#modbus-tcp#tcp-ip#protocol-library#serial-communication#nodejs#arduino#modbus#plc#rs485

Built With

J
JavaScript
N
Node.js
s
serialport

Included in

Node.js65.5k
Auto-fetched 1 day ago

Related Projects

johnny-fivejohnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.

Stars13,412
Forks1,723
Last commit3 years ago
serialportserialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Stars5,993
Forks1,007
Last commit9 months ago
usbusb

Improved USB library for Node.js

Stars1,655
Forks284
Last commit9 days ago
onoffonoff

GPIO access and interrupt detection with Node.js

Stars1,258
Forks122
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub