I am pretty new to JS and am having trouble getting the data from Stream.Writable.
The code I have looks something like this:
const outputStream = new Stream.Writable();
// Other things push data into the Writable stream here
// Get the data from Writable stream here
outputStream.destroy();
The Writable stream doesn't allow direct reading, so I am not really sure how to pull the data from it. Creating a Writable stream to a file and then reading from it seems unnecessarily overcomplicated.
I would like to write the output as a string to a variable.
Has anyone encountered the same task before, and if so, what can you suggest?
I would appreciate any help on this matter!