title: i want to send message without Enterkey in node.js
body: <pre><code>AndroidPhone---------Raspberry Pi ------------Arduino
  (server)              (server)               (bluetooth)
                      (bluetooth)         
  </code></pre>
  
  <p>Now i can send <code>message(0or1)</code> from Android to Raspberry Pi by app
  and i want to send this message to Arduino</p>
  
  <p>However, when i play this code, message is not sent by bluetooth.
  I think (stdin.process.on) is need input by enter.
  but i cant. please help me </p>
  
  <pre class="lang-js prettyprint-override"><code>if (req.payload.toString() === '0') {
    console.log('0');
    process.stdin.on('data', function(data) {
      var buf1 = Buffer.from(data);
      serial.write(buf1,fuction(err, bytesWritten) {
        if (err) console.log(err);
      });
    };
    serial.on('data',function(data){ console.log('Received'+data);
  });
  </code></pre>