About the Nodejs module system involves a lot of knowledge
node is the server-side language, and the client JS is the main difference in several ways
#JS不足
-JS no modular system, closed scopes and dependency management are not supported
-Reputation Standard library, no file system and IOAPI
-No standard interface
-No package management system, cannot automatically load and install dependent-bower
#common. js
-Flexible and convenient
-Convenient combination and decomposition of a love
-Easy to debug and upgrade
-Multi-person collaboration
-Increased high cohesion, low coupling
#模块载入策略
-Modules are divided into two types
The fastest binary that is generated----native module source code compilation
----file module dynamically loaded, slower than native
will be cached
The file module is divided into three types
1.JS script files need to be read into memory before they are compiled and run
2.JSON file FS reads into memory and then translates the JSON object
3. Node compiled binaries that do not need to be compiled and can be run directly
Nodejs Learning Note 02 "module"