Also by the magnificent substack, learning by doing done right: the node.js stream adventure!<p>Install via:<p><pre><code> npm install -g stream-adventure
</code></pre>
Now simply go forth and start your adventure by typing:<p><pre><code> stream-adventure
</code></pre>
Have fun and don't forget to thank the man:<p><a href="https://github.com/substack/stream-adventure" rel="nofollow">https://github.com/substack/stream-adventure</a><p><a href="https://twitter.com/substack" rel="nofollow">https://twitter.com/substack</a>
Not hoping to start any sort of flame war, but could someone try to explain this difference between streams and promises? The conceptual difference doesn't seem completely clear to me.
This is a great write-up on streams. For curiosity sake, I'd be interested to know the overhead of<p><pre><code> var stream = fs.createReadStream(__dirname + '/data.txt');
stream.pipe(res);
</code></pre>
vs. fs.readFile('./data.txt) and res().<p>and if streams become a better and better option as response sizes get larger and larger. The streams syntax is nicer looking in any case.
Will it work with LIVE video streaming?<p>For example, can you use ffmpeg to pull live video via rtsp, re-encode and pipe to nodejs for it to stream down to browser and to be consumed by html - with or without a plugin?<p>Any working code sample?