Object exports

module.exports 的引用

示例代码

  1. // common.js
  2. function sayHello(name) {
  3. console.log(`Hello ${name} !`)
  4. }
  5. function sayGoodbye(name) {
  6. console.log(`Goodbye ${name} !`)
  7. }
  8. module.exports.sayHello = sayHello
  9. exports.sayGoodbye = sayGoodbye