CommonJS vs EsModules


\FunctionalityCommonJS (Microsoft)ES Module (Google)
FunctionalityWorks with the NodeJs platformWorks with the web browser environment
CompilationCompiled into AMD modulesDoes not require a modules loader like AMD
DependenciesAll dependencies are listed inReference any other module in the same
the same file ()package available on the global namespace
Type-checkingNo type-checking capabilitiesRobust typing support via imports
DependencyPackaging up functionalityDeclare dependencies between modules
Packaginginto small pieces
File StructureFlat filesReferences to other modules
ExportExports in the same fileExports scattered through codebase
ImportNo import functionalityMust use a require statement
to access exported functions and
properties