About SerialPort
Node SerialPort is a JavaScript library for connecting to serial ports that works in NodeJS and Electron.
Quick Answers​
- For support, you're in the right place. Have a look around and if you're stuck open a GitHub issue or Discussion.
- To contribute, please review our contribution guide and Code of Conduct. We also have issues tagged "good first PR", if you'd like to start somewhere specific. We'll do our best to support you until we merge your PR.
Core Packages​
The core packages provide cross platform serial port hardware access to a javascript environment (eg, NodeJS and Electron). Chances are you're looking for the serialport
package which provides a good set of defaults. However it is quite easy to mix and match the parts of serialport you need.
serialport
provides a good set of defaults for most projects with a node stream api. It includes cross platform and mock bindings for testing.
Interfaces take a binding interface and provide a different API on top of it. Currently we only ship a Node Stream Interface.
@serialport/stream
a Node.js Stream interface for any binding
The Bindings provide a common interface to work with your serialport cross platform.
@serialport/bindings-cpp
bindings for Linux, Mac and Windows supported in NodeJS and Electron.@serialport/binding-mock
for a mock binding package for testing@serialport/bindings-interface
a typescript interface you need to use match if you're making your own bindings
Parser Packages​
Parsers are used to take raw binary data and transform them into usable messages. This may include tasks such as converting the data to text, emitting useful chunks of data when they have been fully received, or even validating protocols.
Parsers are traditionally Transform streams, but Duplex streams and other non stream interfaces are acceptable.
@serialport/parser-byte-length
@serialport/parser-cctalk
@serialport/parser-delimiter
@serialport/parser-inter-byte-timeout
@serialport/parser-packet-length
@serialport/parser-readline
@serialport/parser-ready
@serialport/parser-regex
@serialport/parser-slip-encoder
@serialport/parser-spacepacket
Command Line Tools​
The Command Line Tools provide helpful utilities for working with serial ports.
Helpful Resources for Getting Started with Node-SerialPort​
In addition to reading the article mentioned above, these others might help you:
- Johnny-Five: The Johnny-Five Robotics and IoT platform's six-line "Hello World" (awesome).
- Arduino Node Security Sensor Hacking: A great all-around "how do I use this" article.
License​
SerialPort is MIT licensed but in order to receive support you must follow our code of conduct which includes a "don't build evil robots" clause.