Converted Saxophone to transform stream. Added example to read me#6
Converted Saxophone to transform stream. Added example to read me#6marcellino-ornelas wants to merge 1 commit intomatteodelabre:masterfrom
Conversation
|
Hey Marcellino! Thank you for the kind words. Really sorry for taking so long to answer you. My understanding is that Transform streams are streams that are both Writable (as the Saxophone stream is currently) and Readable, but I’m having trouble figuring out what kind of text you would expect the readable interface to emit in this context. Could you maybe elaborate on your use case for this? |
a38545d to
ba70179
Compare
cce54b0 to
4ade344
Compare
|
Any update on this? I may be run in the same usecase as @marcellino-ornelas. I'm applying multiple transforms to a stream, using a pipeline, and const { pipeline } = require("stream");
const pump = util.promisify(pipeline);
await pump(
readableStream,
anotherTransform,
parser,
fs.createWriteStream(`output-file`)
);It throws: Making |
|
Hey @matteodelabre I needed this a while ago for a project I was working on but it got put to the side now (not because of this issue). I think my use case was similar to @guerrap that I was trying to pipe the results to another process but was unable to because it wasn't readable it was only writable |
Hey matteoselabre,
First off I want to say that this parser is amazing. It took me a while to find a parser that was super fast and low in memory.
However, I need the parsed XML to be sent to another stream for other processing. It was very difficult to do this with your package now. I don't have too many experiences with streams but I converted your parser to be a transform stream for pipe functionality. I also added an example of how I was able to achieve data getting sent to the next stream in the
readme.mdfile before the contributions section.I ran your test for saxophone and passed all of them. However, I did not have a chance to write my own test.
Not officially asking to merge my work in but hope you'll review and look into it, or develop your own remedy, for people who are running into the same problem. Thanks