@modbus-ts/utils
v0.0.5
Published
The utils package for modbus-ts.
Maintainers
Readme
@modbus-ts/utils
Small utility helpers shared by modbus-ts packages.
Installation
pnpm add @modbus-ts/utilsCore Exports
- sleep
- Deferred
- areArraysEqual
Minimal Example
import { Deferred, areArraysEqual, sleep } from '@modbus-ts/utils'
const gate = new Deferred<void>()
setTimeout(() => gate.resolve(), 100)
await gate.promise
await sleep(50)
const same = areArraysEqual([1, 2], [1, 2])Usage Notes
- Deferred is useful for bridging callback events to async flows
- areArraysEqual is used by subscription change detection
Packages
- high-level Modbus client
- shared contracts, types, and errors
- FC1/FC2/FC3/FC4/FC5/FC6/FC15/FC16 frame encode/decode for TCP/RTU/ASCII
- serial request queue with priority
- polling engine and range merge
- Node TCP transport with reconnect
- Node UDP transport
- browser WebSocket transport with reconnect
- typed Electron main/renderer bridge
- Electron IPC transport adapter
- WebSocket to TCP binary relay gateway
- register-value codec helpers
- shared async and comparison utilities
