module.exports vs exports in Node.js
Asked 07 September, 2021
Viewed 1.7K times
  • 55
Votes

I've found the following contract in a Node.js module:

module.exports = exports = nano = function database_module(cfg) {...}

I wonder what's the difference between module.exports and exports and why both are used here.

24 Answer