BlogProgramming on the Toilet

PoT Episode #6: module.exports

By August 21, 2019 No Comments

What is it?

Programming on the Toilet is a document which contains tips, tricks, snippets or explanations about various programming technologies and paradigms, which could help developers in their everyday job. This episode was brought to you by Kenan Klisura, Lead Software Engineer at Atlantbh.

module.exports

  is an empty object and a property on the module .   is a special object in NodeJS which contains information about the current module. The   property is used to expose properties or functions of the current module. Use   to import properties from some module.

With the introduction of ES Modules via ES6, an   and   keyword can be used for exporting and importing properties.

Want to share these tips in your workplace or at home? Download this episode of Programming on the Toilet here.