Skip to content

Instantly share code, notes, and snippets.

@tacke758
tacke758 / ok_pipe.js
Last active December 10, 2015 19:29 — forked from mironal/ok_pipe.js
Node.jsで標準入力から大きなデータの入力を受ける
process.stdin.resume();
process.stdin.setEncoding('utf8');
var fragment = "";
process.stdin.on('data', function(chunk){
if (chunk == "") { return ;}
var lines = chunk.split("\n");
lines[0] = fragment + lines[0];
fragment = lines.pop();
lines.forEach(function(line){