fork(7) download
  1. process.stdin.resume();
  2. process.stdin.setEncoding('utf8');
  3.  
  4. var stdin = process.openStdin();
  5. stdin.addListener("data", function(d) {
  6. var num = parseInt(d.toString());
  7. if (num != 42)
  8. console.log(num);
  9. else
  10. process.exit(0);
  11. });
Success #stdin #stdout 0.08s 11016KB
stdin
1
2
5
7
2
7
42
stdout
1