esniff

Low footprint ECMAScript source code parser

esniff

Low footprint, fast source code parser, which allows you to find all occurrences of given function/method calls without a need to generate full syntax tree.

var findRequires = require('esniff/function')('require');
 
findRequires('var x = require(\'foo/bar\')');
// [{ point: 17, column: 17, line: 1, raw: '\'foo/bar\'' }] 

In your project path:

$ npm install esniff

You can easily bundle esniff for browser with modules-webmake

Tests

$ npm test