【文件属性】:
文件名称:node-stream-collect:收集流的输出
文件大小:151KB
文件格式:ZIP
更新时间:2021-04-30 07:19:22
JavaScript
流收集
以字符串,缓冲区或对象流(数组)的形式收集可读流的数据。
npm install stream-collect
collect.Collect(options)
使用collect()方法创建直通流并collect事件。
const { Collect } = require ( 'stream-collect' ) ;
const file = fs . createReadableStream ( 'myfile' ) ;
// Collect using a promise
file . pipe ( new Collect ( ) )
. collect ( )
. then ( buffer => { /* use contents */ } ) ;
// Collect using an event
file . pipe ( new Collect (
【文件预览】:
node-stream-collect-master
----.gitignore(12B)
----LICENSE(731B)
----package.json(1KB)
----the-machine-stops.txt(67KB)
----index.js(3KB)
----test.js(8KB)
----npm-debug.log(2KB)
----CHANGELOG(399B)
----README.MD(2KB)
----package-lock.json(492KB)