Node process.stdin Takes Multiple Key Strokes to Emit Data in Raw Mode
<p>I'm trying to catch every keystroke on standard in with Node 6.7.0. Here is what I am doing:</p>

<pre><code>process.stdin.setEncoding('utf8');
process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', function(data) {
    console.log('data', data);
}.bind(this));
</code></pre>

<p>When I run my program, I can press a key and it will log out <code>data d</code> but if I press multiple keys it only logs out a key after three total key presses. It's super weird. Anyone know what might be going on? I am using macOS Sierra terminal.</p>