function handler (err, obj) {
if (err) handleWithContext(err, obj); // obj is undefined :(
}
middleware.run({ url: 'http://facebook.com' }, handler);
The callback should provide the arguments of .run() in case of an error so that I have a context.
I.e. I want to cleanup some resources. Right now you can do this with a closure but not if the callback function is defined somewhere else.
I'd do a PR if you are OK with the API change.