You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: