CommonJs AMD CMD

Source: Internet
Author: User

I've never understood the module specification in JS (CommonJs AMD CMD) (as if I don't understand it now)

1.CommonJS

The CommonJS API provides a number of common applications (primarily non-browser apps) that use the API, and it is said that the ultimate goal is to provide a library of similar python,ruby and Java standards (I copied)

In a system compatible with COMMONJS, you can use JavaScript to develop the following programs:

(1). Server-side JavaScript applications
(2). command-line tools
(3). Graphical Interface Application
(4). Hybrid applications (e.g., titanium or Adobe AIR)

Commonjs defined module is divided into: {Module reference (require)} {module definition (exports)} {module identification (modules)}

Require () to introduce external modules

The exports object is used to export the current module's method or variable, the only export;

Module objects represent the modules themselves.

2.AMD

CommonJs AMD CMD

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.