siddharthkp/auto-install

Replace regex with javascript parser

Closed this issue · 2 comments

Pointed out on hacker news

Regular expressions are a very naive way of detecting calls to 'require'. For correctness you're better off recursively walking the AST.
I've successfully used Detective in a couple of my personal projects to find all require statements.
Relevant issue on Detective: browserify/detective#8

Replaced with node-detective in c58631d

This was super fun

screen shot 2016-08-14 at 8 41 19 pm