nodejs rs232

windows 背景執行
http://bestirtech.com/blog/2019/02/node-windows-service-node-js-app/

kapp

讀取範例1
    var buffer = ''; 
    port.on('data', function(chunk) { 
        buffer += chunk; 
        var answers = buffer.split(/\r?\n/);
    });  

  var resultString = JSON.parse(result.data);
  text.html("Sensor reading:" + resultString);
  // split it:
  var numbers = split(resultString, ",");
————————————————

nodejs  套件 安裝  
—————————————
下npm init 會建立 index.js
npm init -y
npm install -g express –save 
npm uninstall mkdirp –save
npm install mkdirp@1.0.4
npm install http-errors
npm install cookie-parser
npm install morgan
npm install serialport
npm i express-session