Created
June 8, 2011 07:23
-
-
Save aredridel/1013963 to your computer and use it in GitHub Desktop.
Read from a stream: works with a FIFO.
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 fs = require('fs') | |
var s = fs.createReadStream('x') | |
s.on('data', function(b) { console.log(b) }) |
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
mkfifo x | |
node reader.js & | |
echo "Hello!" > x |
Nope. Just a question on #node.js -- "how do I read from a FIFO in node?" -- answered in code. I personally find fifos entirely antiquated and it's usually better to use a socket.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice :) . Were you think of using something like this for anything in particular?