How can I create a readable stream from an in-memory object in javascript / nodejs?
I am using 2 libraries - pdfkit and ftp. PDFKit produces a PDF object, which I want to upload from the node app to a remote FTP server.
https://github.com/mscdex/node-ftp
- put(<ReadableStream>inStream, <string>filename, <function>callback) - success - Sends a file to the server.
there's lot of resources on how to create readable streams from files, but is it possible to create a readable stream from an in-memory object without using the fs, or would I have to create my own wrapper with emitters? I am not sure on the approach to this.