ES6 Modules

GPTKB entity

Statements (27)
Predicate Object
gptkbp:instanceOf JavaScript module system
gptkbp:allows circular dependencies (with caveats)
gptkbp:alsoKnownAs gptkb:ECMAScript_Modules
gptkbp:canBeLoaded asynchronously in browsers
gptkbp:compatibleWith top-level await (before ES2022)
dynamic require
gptkbp:defaultExportSyntax export default
gptkbp:enables static analysis
tree shaking
code modularization
gptkbp:example import {foo} from './foo.js';
gptkbp:exportExample export function foo() {}
gptkbp:fileExtension .js
.mjs
https://www.w3.org/2000/01/rdf-schema#label ES6 Modules
gptkbp:importSyntax import
gptkbp:introducedIn gptkb:ECMAScript_2015
gptkbp:namedExportSyntax export
gptkbp:replacedBy CommonJS in some environments
gptkbp:scope strict mode by default
gptkbp:specifies gptkb:ECMA-262
gptkbp:supportedBy modern browsers
Node.js (with .mjs or "type": "module")
gptkbp:supports export syntax
import syntax
gptkbp:bfsParent gptkb:AMD_(Asynchronous_Module_Definition)
gptkbp:bfsLayer 7