Node.js/stream:修订间差异
来自康健生活
| 第164行: | 第164行: | ||
}); | }); | ||
};</syntaxhighlight> | };</syntaxhighlight> | ||
使用管道。 | |||
<syntaxhighlight lang="javascript"> | |||
fs.createReadStream('/path/to/source').pipe(fs.createWriteStream('/path/to/target'));</syntaxhighlight> | |||
== 技巧 == | == 技巧 == | ||