I need to be able to read the serial port from within my JS code. I recently stumbled across this component https://github.com/voodootikigod/node-serialport
What are the requirements for the client computer O/S?
To install it, all it says to do is
npm install serialport
What is that? Where should this command be run? More details would be appreciated.
Thank you
The module you've pointed out is for node.js an event-driven Javascript application server. The emphasis here is that node.js is server-side, not something that runs in a browser.
The command you've pointed out invokes npm, a package manager for node.js. You would need to execute that command on the server where the code expects to run.
While only the author of the code will be able to give you an authoritative answer, a quick review of both the Javascript and the C++ code doesn't seem to reveal anything that's platform specific.
Well, as long as you can compile that C++ code. That looks to be a problem if your server is on Windows.
The library seems to want to treat the serial port as a regular file. While this should be an obvious way to do it if you're on a Unixish operating system (Linux, BSD, Solaris, OS X, etc -- though I don't think Macs have had serial ports in a few decades), it's not immediately clear or obvious if you can just ask Windows to open COM1
and have it work correctly.
So, chances are that you'll have a much larger chance of success if you're hosting this on a Unix than on Windows.