如何将缓冲区包装为stream2可读流? [英] How to wrap a buffer as a stream2 Readable stream?

查看:38
本文介绍了如何将缓冲区包装为stream2可读流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用stream2接口之后,如何将node.js缓冲区转换为可读流?

How can I transform a node.js buffer into a Readable stream following using the stream2 interface ?

我已经找到了 answer 和流-缓冲模块,但此模块基于stream1接口.

I already found this answer and the stream-buffers module but this module is based on the stream1 interface.

推荐答案

使用流化器,您可以使用新的流API将字符串和缓冲区转换为可读流.

With streamifier you can convert strings and buffers to readable streams with the new stream api.

这篇关于如何将缓冲区包装为stream2可读流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆