Skip to content

Instantly share code, notes, and snippets.

@mironal
Created August 10, 2012 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mironal/3310996 to your computer and use it in GitHub Desktop.
Save mironal/3310996 to your computer and use it in GitHub Desktop.
var inputText = "";
process.stdin.on('data', function(chunk){
// 入力されてきた文字列をひたすら連結
inputText += chunk;
});
// ストリーム終了時に呼ばれる.
process.stdin.on('end', function(){
inputText.split('\n').forEach(function(){
// なんか処理する
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment