Last active
May 2, 2017 17:06
-
-
Save spencerbeggs/f8dca6e9d08663d0fe8f63a51e7fa001 to your computer and use it in GitHub Desktop.
Module Export demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function bar() { | |
console.log("bar"); | |
} | |
export function bar2() { | |
console.log("bar2"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function foo() { | |
console.log("foo"); | |
} | |
export function foo2() { | |
console.log("foo2"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export { foo } from "./foo"; | |
export { bar } from "./bar"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as foobar from "./index.js"; | |
foobar.foo(); | |
// "foo" | |
foobar.bar(); | |
// bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment