node-red-contrib-chatbot
Version:
REDBot a Chat bot for a full featured chat bot for Telegram, Facebook Messenger and Slack. Almost no coding skills required
16 lines (13 loc) • 377 B
JavaScript
const { Readable } = require('stream');
/**
* Creates a readable stream from a Buffer.
* @param {Buffer} buffer - The buffer to stream.
* @returns {Readable} - The readable stream.
*/
function bufferToStream(buffer) {
const stream = new Readable();
stream.push(buffer);
stream.push(null); // Signal end of stream
return stream;
}
module.exports = bufferToStream;