Skip to content
New issue

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

Made an event-driven Parser class #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

internot
Copy link

One of the features of the parser is that it can continuosly parse chunks of text. I extended domino with an event-driven Parser class that takes an EventEmitter as argument and parse each chunk as it becomes available. I use it to parse the result of a http request without having to store it in a temporary buffer:

http.request(req, function(pres) {
var parser = new domino.Parser();
parser.parse(pres);
parser.on('end', function() {
var document = parser.document();
...
});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant