title: Node JS not able to trigger end usinf stdin
body: <p>I am using NodeJS version v6.9.4. I am trying to execute the below sample code. It continuously but not ending the program. Can anyone help me solve my problem.</p>
  
  <pre><code>var stdin = process.stdin,
      stdout = process.stdout,
      inputChunks = [];
  
  #stdin.resume();
  stdin.setEncoding('ascii');
  
  stdin.on('data', function (chunk) {
      inputChunks.push(chunk);
  });
  
  stdin.on('end', function () {
      var inputJSON = inputChunks.join(),
          parsedData = JSON.parse(inputJSON),
          outputJSON = JSON.stringify(parsedData, null, '    ');
      stdout.write(outputJSON);
      stdout.write('\n');
  });
  </code></pre>