Simple AOP library for both Node.js and browsers.
function base() {}
// compose a new function which calls a function after base returns
var fn = advice.after(base, function() {
console.log('base was called');
});
var obj = {
foo: function() {}
};
// redefine a method which calls a function after obj.foo returns
advice.after(obj, 'foo', function() {
console.log('obj.foo was called');
});
MIT