This repository was archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
About ECMAScript 6 modules
Soma Lucz edited this page Apr 13, 2017
·
25 revisions
ECMAScript 6 gives us the possibility to write modular JavaScript softwares by using sort of Java-like importing.
- Introduction to ECMAScript 6 modules: http://2ality.com/2014/09/es6-modules-final.html
- Further very good summary documentation: http://exploringjs.com/es6/ch_modules.html
- Exports' grammar from ECMA International: http://www.ecma-international.org/ecma-262/6.0/#sec-exports
- Imports' grammar from ECMA International: http://www.ecma-international.org/ecma-262/6.0/#sec-imports
export { name1, name2, … };
export { name1 as exportedName1, name2 as exportedName2, … };
export let name1, name2, … ;
export var name1, name2, … ;
export let name1 = …, name2 = …, … ;
export var name1 = …, name2 = …, … ;
export const name1 = …, name2 = …, … ;
export expression;
export default expression;
export default class { … }
export default function (…) { … }
export default function* (…) { … } // generator
export default class name1 { … }
export default function name1(…) { … }
export default function* name1(…) { … } // generator
export { name1 as default, … };
export * from …;
export { name1, name2, … } from … ;
export { import1 as importedName1, import2 as importedName2, … } from …;Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
import defaultName from "exporter";
import * as exportedModule from "exporter";
import { name1, … } from "exporter";
import { name1 as importedName1, … } from "exporter";
import defaultName, { name1 [ , [...] ] } from "exporter";
import defaultName, * as exportedModule from "exporter";
import "exporter";Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
Codemodel-Rifle // Graph-based incremental static analysis of ECMAScript 6 source code repositories
All code in this repository is available under the Eclipse Public License v1.0 and is supported by the MTA-BME Lendület Research Group on Cyber-Physical Systems.