Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require对象 以及导出的到底是谁 #4

Open
codevvvv9 opened this issue Jan 4, 2019 · 0 comments
Open

require对象 以及导出的到底是谁 #4

codevvvv9 opened this issue Jan 4, 2019 · 0 comments
Labels
basic nodejs The basis of nodejs

Comments

@codevvvv9
Copy link
Owner

require对象很复杂

  • 好多属性
  • cache属性保证了它只会require一次
  • 基于上述一点,可以做热更新

nodejs中导出实际上是module.exports

  • exports只是module.exports的引用而已,核心是后者
@codevvvv9 codevvvv9 added the basic nodejs The basis of nodejs label Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic nodejs The basis of nodejs
Projects
None yet
Development

No branches or pull requests

1 participant