Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Readable } = require('stream');
- function bufferToStream(binary) {
- const readableInstanceStream = new Readable({
- read() {
- this.push(binary);
- this.push(null);
- }
- });
- return readableInstanceStream;
- }
- //
- let bdata =Buffer.from("Hello, how are you?","utf-8")
- let streamdata = bufferToStream(bdata);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement