Re:Show HN: Auto install npm dependencies as you code
by _RPM on Monday August 08, 2016 @01:59PM
(#12249637)
It has to parse a javascript file, which isn't trivial. The reason they use regular expression is because implementing a javascript parser isn't an easy problem to solve fast, even though the grammar is available.
[ Parent
| on HN ]
Re:Show HN: Auto install npm dependencies as you code
by Etzos on Monday August 08, 2016 @03:15PM
(#12250186)
One certainly does not need to implement a parser, just use one of the many available. As the sibling here pointed out the time it would take to parse and walk the AST is negligible compared to the downloads happening.
Re:Show HN: Auto install npm dependencies as you code
by elmigranto on Monday August 08, 2016 @02:15PM
(#12249751)
You downloading megabytes over network and performing disk IO with it. What's the problem with 100 milliseconds of file parsing?