We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i know when parsing has done? I've tried to listen "end" and "close" events since they are in the source code but they don't get triggered.
The text was updated successfully, but these errors were encountered:
I found that it actually emits close event if it piped to node readable stream. here is the code:
close
const { Readable } = require('stream') const expat = require('node-expat') const data = '<xmldoc>...</xmldoc>' const xmlParser = new expat.Parser('UTF-8') xmlParser.on('startElement', function (name, attrs) {}) xmlParser.on('error', function(err) { throw err }) xmlParser.on('close', function() { // done! }) const xmlStrStream = new Readable() xmlStrStream.push(data) xmlStrStream.push(null) xmlStrStream.pipe(xmlParser)
Sorry, something went wrong.
No branches or pull requests
How can i know when parsing has done? I've tried to listen "end" and "close" events since they are in the source code but they don't get triggered.
The text was updated successfully, but these errors were encountered: