TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Node.js stream handbook

113 pointsby hoggleover 10 years ago

5 comments

hoggleover 10 years ago
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&#x27;t forget to thank the man:<p><a href="https://github.com/substack/stream-adventure" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;substack&#x2F;stream-adventure</a><p><a href="https://twitter.com/substack" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;substack</a>
shortstuffsushiover 10 years ago
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&#x27;t seem completely clear to me.
评论 #8773226 未加载
评论 #8773501 未加载
评论 #8773795 未加载
评论 #8773375 未加载
dpwebover 10 years ago
This is a great write-up on streams. For curiosity sake, I&#x27;d be interested to know the overhead of<p><pre><code> var stream = fs.createReadStream(__dirname + &#x27;&#x2F;data.txt&#x27;); stream.pipe(res); </code></pre> vs. fs.readFile(&#x27;.&#x2F;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.
评论 #8772855 未加载
评论 #8773838 未加载
yudongover 10 years ago
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?
评论 #8776074 未加载
fiboover 10 years ago
Can&#x27;t believe it was not in HN yet
评论 #8774162 未加载