function-body-regex is regex to rip off function body.
var regex = require('function-body-regex');
var fn = function() {
console.log('this is function body.');
return true;
};
var ret = regex.exec(fn.toString());
console.log(ret[1]); // => '\nconsole.log(\'this is function body.\');\nreturn true;\n'$ npm install function-body-regex
MIT