Node 中引入一个模块的方法及其细节

前端工程化系列 Node进阶系列 在 node 环境中,有两个内置的全局变量无需引入即可直接使用,并且无处不见,它们构成了 nodejs 的模块体系: module 与 require 。以下是一个简单的示例 const fs = require('fs') const add = (x, y) => x + y module.exports = add 虽然它们在平常使用中仅仅是引入与导出模
相关文章
相关标签/搜索