AMD is the normalized output of the module defined by Require.js in the promotion process.
1. Relying on the predecessor
function (Alpha) { returnfunction() { return alpha.verb () + 2; } }; });
CMD is the normalized output of the module definition in the sea.js process.
1. Reliance on the nearest
Define (function(require, exports) { // get module A's interface var a = require ('./a ') ; // method of calling module a a.dosomething ();});
Common.js specification front-end browser is not supported, usually using this specification on server node
Output: Exports. method
Node provides a exports variable for each module, pointing to Module.exports
Module.exports
module.exports
property represents the external output interface of the current module, and the other file loads the module, actually reading the module.exports
variable.
ES6
Export default {} defaults output
Import input
Amd,cmd,common.js and ES6 Simple comparison