Formats

global

The original way to import javascript code was a global hook (execute on include or inline) or a namespaced global (where a global variable is set as a side effect of inclusion). Until bundling became popular, this was still prevalent and even today, many legacy codebases use this directly or via CDN.

AMD/UMD

AMD is the module format used by the vernerable require.js library, while UMD is a modern polymorphic definition which could support AMD, commonjs and namespaced globals.

commonjs

commonjs ia the original native node.js module format. It was created to solve a set of problems common to most apps of the era.

esmodules

ES Modules is the first standards body driven module system to encompass all of javascript and as such aims to both provide a formal system for browsers as well as replace commonjs for node.js (and serve as the basis for deno).