-
-
Save polotek/977813 to your computer and use it in GitHub Desktop.
accepting input from a pipe, nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function(chunk) { | |
data += chunk; | |
}); | |
process.stdin.on('end', function() { | |
callback(data) | |
}); | |
setInterval(function() { | |
console.error('working'); | |
}, 1e3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should change
var data;
tovar data = '';
or else the data will be "undefinedTHE_ACTUAL_DATA"