Nodejs Learning Note 02 "module"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.