javascript-idents walks a JavaScript AST and collects all Identifier AST nodes. It relies on Marijn
Haverbeke's acorn.js for AST walking, and it should be
compatible with any SpiderMonkey Parser
API-compliant JavaScript AST.

It is intended for use in node.js but can be adapted to work in other JavaScript environments.