How to throw Timeout Exception when parsing a large JS file #15230
-
Hi, we want to use babel's parse function, but for large files over 1M, it may get stuck for a long time, is there a way to throw a Timeout Exception when the parsing process times out? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
nicolo-ribaudo
Nov 28, 2022
Replies: 1 comment
-
You can do the parsing in a worker, and kill the worker after X seconds. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
liuxingbaoyu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do the parsing in a worker, and kill the worker after X seconds.