Exports property in node?

This question already has an answer here:

  • What is the purpose of Node.js module.exports and how do you use it? 10 answers

  • Exports are the publicly visible interface of a module. When using a module you can access anything that was exported from the module.

    This allows you to hide private implementation details of your module and only export the objects, properties and functions you want to be able to be used from outside.

    Modules are one solution to the Javascript problem of lack of privacy and classes. Enabling you to encapsulate private data and behaviours effectively.

    链接地址: http://www.djcxy.com/p/96626.html

    上一篇: 这个Javascript“需要”是什么?

    下一篇: 在节点中导出属性?