Extracts your functions from JavaScript code and returns them in an Object
npm install fn-extractor
var extract = require('fn-extractor');
var functions = extract('(function () { function foo() { return 1; } })');
typeof functions.foo === 'function' // true
functions.foo() === 1 // true