【文件属性】:
文件名称:pipe-io:管道流和处理事件
文件大小:177KB
文件格式:ZIP
更新时间:2021-05-29 12:09:54
nodejs javascript stream pipe JavaScript
管道
管道和处理事件。
安装
npm i pipe-io
应用程序接口
管道
在流之间创建管道并添加回调,只要一切都完成或发生错误,就会调用一次。
const fs = require ( 'fs' ) ;
const pipe = require ( 'pipe-io' ) ;
const tryToCatch = require ( 'try-to-catch' ) ;
const NAME = 'README.md' ;
const NAME2 = 'README2.md' ;
const readStream = fs . createReadStream ( NAME ) ;
const writeStream = fs . createWriteStream ( NAME2 ) ;
const [ e ] = await tryToCatch ( pipe , [ re
【文件预览】:
pipe-io-master
----.travis.yml(182B)
----package.json(1KB)
----.eslintrc.json(479B)
----test()
--------fixture()
--------pipe.js(10KB)
----LICENSE(1KB)
----.npmignore(35B)
----.gitignore(68B)
----lib()
--------pipe.js(4KB)
----.nycrc.json(240B)
----ChangeLog(6KB)
----README.md(2KB)
----.madrun.mjs(538B)