-
Notifications
You must be signed in to change notification settings - Fork 2
/
EXAMPLES.txt
46 lines (35 loc) · 1.52 KB
/
EXAMPLES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export1 as alias1 } from "module-name";
import { export1 , export2 } from "module-name";
import { export1 , export2 as alias2 , [...] } from "module-name";
import defaultExport, { export1 [ , [...] ] } from "module-name";
import defaultExport, * as name from "module-name";
import type x from "module-name";
import * from "module-name";
import "module-name";
var promise = import("module-name");
var promise = require("module-name");
// Aggregating modules
export * from "module-name"; // does not set the default export
export * as name1 from "module-name"; // Draft ECMAScript® 2O21
export { name1, name2, …, nameN } from "module-name";
export { import1 as name1, import2 as name2, …, nameN } from "module-name";
export { default, … } from "module-name";
// Exporting individual features
export let name1, name2, …, nameN; // also var, const
export let name1 = …, name2 = …, …, nameN; // also var, const
export function functionName(){...}
export class ClassName {...}
// Export list
export { name1, name2, …, nameN };
// Renaming exports
export { variable1 as name1, variable2 as name2, …, nameN };
// Exporting destructured assignments with renaming
export const { name1, name2: bar } = o;
// Default exports
export default expression;
export default function (…) { … } // also class, function*
export default function name1(…) { … } // also class, function*
export { name1 as default, … };