Open martinfranz opened 4 years ago
@martinfranz I'm suspecting it's because parser emitting only 'end'
event, but not 'finish'
as expected by pipeline function.
Had the same issue, I'm using this work-around:
parser.once('end', () => parser.emit('finish'))
Hi, with node V10 (maybe even earlier versions), SAXStream is not signaling an end. So:
await pipeline( fs.createReadStream(fileName, 'utf8'), parser ) console.log('finish')
will never reach "finish". I'm not a master of node streams, just created some write streams. I could fix that issue (at least for my use case) by changing to Stream = require('stream').Writable, deleting the SAXStream.prototype.end function and used SAXStream.prototype._final = function (cb) { this._parser.end() if (cb) cb() } Maybe somebody with better knowledge about node streams could fix the original sax code. At least, my simple fix resolved that particular issue... Best regards, Martin