CommonJS Modules

GPTKB entity

Statements (49)
Predicate Object
gptkbp:instanceOf JavaScript module system
gptkbp:alternativeTo gptkb:ECMAScript_Modules
gptkbp:canBeBundledWith gptkb:Webpack
gptkb:Browserify
gptkbp:defaultExport module.exports
gptkbp:exportSyntax module.exports
gptkbp:fileExtension .js
gptkbp:hasFeature exports object
caching of required modules
circular dependency support
module object
require.cache
require.main
require.resolve
https://www.w3.org/2000/01/rdf-schema#label CommonJS Modules
gptkbp:importSyntax require()
gptkbp:influenced gptkb:Parcel
gptkb:Rollup
gptkb:Webpack
gptkb:RequireJS
gptkb:ECMAScript_Modules
gptkb:Browserify
Node.js module system
gptkbp:introduced CommonJS project
gptkbp:limitation cannot be used in strict mode by default
exports are mutable
no native support for asynchronous loading
no support for dynamic imports
no support for import.meta
no support for import/export syntax
no support for live bindings
no support for module namespace objects
no support for named exports
no support for static imports
no support for top-level await
no tree-shaking
not interoperable with ESM without transpilation
not natively supported in browsers
static analysis is difficult
synchronous module resolution
gptkbp:mainFunction modularize JavaScript code
gptkbp:notSupportedNativelyIn browsers
gptkbp:scope file-scoped
gptkbp:standardizedBy 2009
gptkbp:supportsSynchronousLoading true
gptkbp:usedFor server-side JavaScript
gptkbp:usedIn gptkb:Node.js
gptkbp:bfsParent gptkb:AMD_(Asynchronous_Module_Definition)
gptkbp:bfsLayer 7