exports = handle
This creates a local variable with the name exports. This is different from overwriting module.exports.
module.exports = handle
This overwrites the export variable, which lives in the module area, then it will be read require.
The browser window["foo"]and foothe same, but the node module["foo"]and foobehave differently.
The local context of the variable region and moduleis not the same thing.
source
share