什么是 commonjs2
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 483 (opens in a new tab)
Author 回答者: maya1900 (opens in a new tab)
commonjs 规范只定义了exports,而 module.exports是nodejs对commonjs的实现,实现往往会在满足规范前提下作些扩展,我们这里把这种实现称为了commonjs2.
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 483 (opens in a new tab)
Author 回答者: maya1900 (opens in a new tab)
commonjs 规范只定义了exports,而 module.exports是nodejs对commonjs的实现,实现往往会在满足规范前提下作些扩展,我们这里把这种实现称为了commonjs2.