[Node.js] Difference between module.exports and exports

Tadashi Shigeoka ·  Sun, August 9, 2015

To just state the conclusion: if you’re not sure, use module.exports.

Nodejs

The Node.js official documentation says the same thing.

As a guideline, if the relationship between exports and module.exports seems like magic to you, ignore exports and only use module.exports.

If you want to know more about the difference between module.exports and exports, you might want to read the following articles:

That’s all from the Gemba.