var fs =require('fs');var detect =require('acorn-globals');var src =fs.readFileSync(__dirname +'/input.js','utf8');var scope =detect(src);console.dir(scope);
input.js
var x =5;var y =3, z =2;w.foo();w =2;RAWR=444;RAWR.foo();BLARG=3;foo(function () {varBAR=3;process.nextTick(function (ZZZZZZZZZZZZ) {console.log('beep boop');var xyz =4; x +=10;x.zzzzzz;ZZZ=6; });functiondoom () { }ZZZ.foo();});console.log(xyz);