Few hours ago I got introduced to burrito, a JavaScript lib that can analyze JavaScript code in a super simplified way.
I start playing with it and I love it!
https://github.com/substack/node-burrito
It built up to work on top of node.js
Here is a simple example: generating a list of all the functions
var fs = require('fs');
var burrito = require('burrito');
var functionList = [];
fs.readFile('someFile.js', function (err, data) {
if (err) throw err;
var dataStr = data.toString();
burrito(dataStr, function (node) {
if (node.name === 'function' || node.name === 'defun'){
functionList.push(node.value[0]);
}
});
});
This is fun!
You can even wrap any function-invocation easily utilizing node.wrap(—)..
This makes profiler development much easier than ever before..

Advertisement
Nice! will try it!