阅读背景:

nodejs模块和重复?如果一个应用程序使用两个需要一个公共模块的模块,那么node是否会优化以避免两次加载相同的代码?

来源:互联网 

Apologies if this is a dumb question, but if I create 2 modules that both require('http') and my main application that requires both modules, or requires modules that in turn require both modules, while also requiring 'http' for its own purposes, do I end up with three instances of the http module, each locked within the scope of a different closure, or does node rewrite things to avoid this?Apologies if this is a dumb question, but if I




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: