When exporting a module that has another dependency, is it best to include that dependency within the module export function or outside of it? I usually see the latter, but it seems like it would be best to keep it in the local scope.
For example:
var foo = require('foo');
module.exports = function(d) {
return foo(d)/2;
}
vs.
module.exports = function(d) {
var foo = require('foo');
return foo(d)/2;
}