Created
September 4, 2019 16:48
-
-
Save rao123dk/6f92d59555d6c5053cbdd26e7edba457 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment