【文件属性】:
文件名称:TestStream:测试您的可读双工流结果
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-02 21:25:55
JavaScript
测试流
TestStream 是一个简单的可写流实现,它在流完成时缓冲所有要测试的传入数据。 这对于尝试进行端到端测试的可读/双工/转换流实现者很有用。
用法
// `Hello, World!` is the contents of `file.txt`
fs . creatReadStream ( 'file.txt' )
. pipe ( TestStream ( ) )
. on ( 'testable' , function ( data ) {
// data -> Buffer('Hello, World!');
} ) ;
// TestStream also works for `objectMode` streams.
Model . find ( { } ) . stream ( )
. pipe ( Tes
【文件预览】:
TestStream-master
----.gitignore(13B)
----package.json(537B)
----LICENSE(1KB)
----index.js(2KB)
----README.md(696B)
----test()
--------teststream.spec.js(1KB)