Streams
@CrabDude 已经在做这个了。
开始于 2015年5月5日。
评估
这个 Issue 还没有评估数据。
描述
- Break the below into coherent sections
- Explain unix pipes and their corollary with node.js streams (explaining the concept of node.js streams as well)
- Explain the need for streams (memory pressure, decreased latency, CPU amortization & convenience)
- Lead with
.pipeexamples- Emphasize that source streams can be piped to multiple destination streams
- Show example of piping from multiple source streams (
readable.pipe(writable, {end: false}))
- Cover the basics: .read(), .write(), .pause(), .resume & events: 'data', 'close', 'error'
- Mention briefly push vs pull-based streams and how Streams 2/3 uses pull streams
- Mention how back-pressure is handled
- Briefly explain buffers, link to a reference (docs or blog post or guide), and show
String(buffer) - Show 2 simple as possible examples of consuming (read: piping) each of the 4 stream types. You should use the most common examples e.g., req/res, through, fs read/write.
- Provide a common use case (e.g., A common type of duplex stream would be a WebSocket).
- Strongly recommend working through the stream-adventure nodeschool.io workshop and provide a screen shot of the stream-adventure exercise selection menu.
Advanced section:
- Explain object mode briefly, provide minimalist example and provide link to a more comprehensive explanation
- Provide code samples on how to create your own streams (i.e., .push, _read, _write & _transform) and additional links
- Show of JSON streaming example & explain !!LOUDLY!! how JSON.parse/stringify are the #1 cause of CPU blocking in node.js
The stream handbook is nice, but it's too verbose and needs more structure. In general the examples are good, so use them.
What success looks like: Succinctness and clarity. Less is more.
Reference Wikis: Authentication & Authorization, Setup
Open separate issues for required links to community sources if you're having trouble finding any.
Please assign to yourself before working on this.
/cc @NinjaSudo @philster @azoff @DiyahM
- 主要语言
- 没有语言数据
- 星标
- 74
- 派生
- 18
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codepath/nodejs_guides 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 20/100
codepath/nodejs_guides#21 · 1 条评论 ·
-
Improve Javascript/Node markdown syntax highlighting可能重新可做 @nesquena 于 4186 天前认领,目前没有进行中的 PR。 未关闭enhancement
codepath/nodejs_guides#19 · 1 条评论 · 已指派 1 人 ·
-
help wanted
难度 4/5 3-5 天 新手友好度 35/100
codepath/nodejs_guides#18 · 3 条评论 ·
-
Design Patterns可能重新可做 @pixelknitter 于 4071 天前认领,目前没有进行中的 PR。 未关闭help wanted
codepath/nodejs_guides#16 · 已指派 1 人 ·
-
JavaScript: Inheritance可能重新可做 @pixelknitter 于 4179 天前认领,目前没有进行中的 PR。 未关闭help wanted
codepath/nodejs_guides#14 · 已指派 1 人 ·