Skip to content

Instantly share code, notes, and snippets.

@jupegarnica
Created July 9, 2021 17:59
Show Gist options
  • Save jupegarnica/134c3846a33009b3a1e128fe81dc7bae to your computer and use it in GitHub Desktop.
Save jupegarnica/134c3846a33009b3a1e128fe81dc7bae to your computer and use it in GitHub Desktop.
// These give you a live reference to the exported thing(s):
import { thing } from './module.js';
import { thing as otherName } from './module.js';
import * as module from './module.js';
const module = await import('./module.js');
// This assigns the current value of the export to a new identifier:
let { thing } = await import('./module.js');
// These export a live reference:
export { thing };
export { thing as otherName };
export { thing as default };
// These export the current value:
export default thing;
export default 'hello!';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment