Skip to content

zh-CN: Add or Fix formations of translated files #1777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locale/zh-cn/docs/guides/backpressuring-in-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ inp.pipe(gzip).pipe(out);

请注意:这个例子中我们使用 `.pipe()` 从一个数据源终端到另外一个终端,不过没有使用任何出错处理机制。如果一大堆数据出错了但是又要被接收, `可读` 和 `gzip` 流不会被销毁。 [`pump`][] 是一个工具类,如果有某个流发生错误或者关闭,它会自动销毁相关所有的流,在这个情况下是必须使用的!

[`pump`][] 对于 Nodejs 8.x 以及先前版本是必须的。但对于 10.x 和之后的版本而言,我们引入了 [`pipeline`][] 来取而代之它。这是一个模块化函数,用于对接不同的数据流,可以处理异常错误并善后清理释放资源。它同时也提供了一个回调函数——当整个 pipeline 任务完成时将触发。
[`pump`][] 对于 Nodejs 8.x 以及先前版本是必须的。但对于 10.x 和之后的版本而言,我们引入了 [`pipeline`][] 来取而代之。这是一个模块化函数,用于对接不同的数据流,可以处理异常错误并善后清理释放资源。它同时也提供了一个回调函数——当整个 pipeline 任务完成时将触发。

这里给出一个例子,告诉你如何使用 pipeline:

Expand Down
2 changes: 1 addition & 1 deletion locale/zh-cn/docs/guides/buffer-constructor-deprecation.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,6 @@ function stringToBase64(req, res) {
当使用 `Buffer.from(req.body.string)` 的时候,如果传入一个数字总是抛出异常,给程序提供了一个总是可以自我处理的机会。

<a id="ecosystem-usage"></a>
###`Buffer()` 构造函数废弃有一阵了,它有问题吗?
### `Buffer()` 构造函数废弃有一阵了,它有问题吗?

检测 `npm` 生态系统的代码,表明 `Buffer()` 仍然广泛被使用。这包含新提交的代码,以及这类代码的使用仍然在 *增长中*。
1 change: 1 addition & 0 deletions locale/zh-cn/docs/guides/dont-block-the-event-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Node 是用一组少量的线程来处理许多客户端请求的。

1. 性能:如果你定期通过任意的某种形式线程处理繁重的任务,你的服务器将面临 *吞吐量*(请求/秒)的考验。
2. 安全性:如果对于特定的输入,你其中的一个线程阻塞了,那么恶意攻击者可以提交如此的“邪恶输入”,故意让你的线程阻塞,然后使得其它客户端得不到处理。这就是 [拒绝式攻击](https://en.wikipedia.org/wiki/Denial-of-service_attack)。

## 对 Node 的快速回顾

Node 使用事件驱动机制:它有一个事件轮询的编排,和一个为高消费任务的处理工作池。
Expand Down
8 changes: 4 additions & 4 deletions locale/zh-cn/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
"link": "docs/es6",
"text": "ES6 及更高"
},
"inspector": {
"link": "docs/inspector",
"text": "调试"
},
"api-lts": {
"link": "/dist/latest-%ver-major%/docs/api",
"subtext": "LTS",
Expand All @@ -112,6 +108,10 @@
"link": "get-involved/code-and-learn",
"text": "代码与学习"
},
"collab-summit": {
"link": "get-involved/collab-summit",
"text": "协作者峰会"
},
"contribute": {
"link": "get-involved/contribute",
"text": "贡献"
Expand Down