const foo = require("foo"); // starts out as empty object exports.bar = function() { return foo.fn(); }
let x = require('foo').x
of course, cannot do that. It's a small difference but it does make it easier to fall into the happy path in more cases.