A bidirectional WebSocket-to-serial port bridge for Node.js, allowing web clients to send/receive commands to Arduino or Raspberry Pi boards via serial. Version 1.0.9 is the latest release. It supports multiple WebSocket connections simultaneously and provides a simple API to configure serial port name and baud rate. Useful for IoT and robotics projects requiring real-time communication between a browser and serial devices.
npm install serial-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a bidirectional WebSocket-to-serial bridge on port 8081 connected to the specified serial port.
Use require('serial-websocket') instead of import.Be careful with the name; it is a string, not a number.
Upgrade to version >=1.0.6 to have stop() available.
Invoke serialWebsocket(options) as a function (not constructor).
Use const serialWebsocket = require('serial-websocket'); const server = serialWebsocket(options);Run npm install serialport in your project.
Assign the result of serialWebsocket(options) to a variable, then call start() on that variable.
Change webSocketPortNumber option to an unused port.