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

finish dispatched before completion #10

Open
joshjung opened this issue Nov 25, 2014 · 2 comments
Open

finish dispatched before completion #10

joshjung opened this issue Nov 25, 2014 · 2 comments

Comments

@joshjung
Copy link

I'm trying to get some sort of output when the tokenizer has completed. end is never dispatched for me. In addition, I can listen for finish but because process.nextTick() force the final tokenization to occur on the next NodeJS frame, the finish is dispatched right before the last token is processed.

Is there a reason that _transform and _flush use process.nextTick()?

@joshjung
Copy link
Author

For reference on the project that I was trying to use tokenizer for:

https://github.com/joshjung/slim-to-jade

I'm giving up for now because it was becoming too much work (was running into issues with tokens that crossed the chunk size for example). Let me know if you have any time @Floby to discuss! Would really, really appreciate it.

@farskipper
Copy link

Hey, I also had and issue with end not being dispatched, so I ended up making tokenizer2 which wraps through2 to ensure all the stream APIs all work as expected.

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

No branches or pull requests

2 participants