文件名称:it-to-stream::potable_water:将流式可迭代对象转换为Node.js流
文件大小:111KB
文件格式:ZIP
更新时间:2024-05-20 20:22:57
JavaScript
流媒体 将流式可迭代对象转换为Node.js流 安装 npm i it-to-stream 用法 const toStream = require ( 'it-to-stream' ) 将源可迭代的源转换为可读流 // A streaming iterable "source" is just an (async) iterable const source = ( async function * ( ) { for ( const value of [ 1 , 2 , 3 , 4 ] ) yield Buffer . from ( value . toString ( ) ) } ) ( ) const readable = toStream . readable ( source ) // Now we have a readable stream, we can consum
【文件预览】:
it-to-stream-master
----src()
--------transform.js(370B)
--------duplex.js(2KB)
--------index.js(429B)
----.travis.yml(47B)
----LICENSE(1KB)
----test()
--------transform.test.js(3KB)
--------writable.test.js(2KB)
--------duplex.test.js(729B)
--------helpers()
--------readable.test.js(1KB)
----README.md(4KB)
----.gitignore(34B)
----package-lock.json(392KB)
----package.json(1KB)