Skip to content

Instantly share code, notes, and snippets.

@amysimmons
Last active July 8, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amysimmons/d0233466e5614e724aa50ff4190be7bb to your computer and use it in GitHub Desktop.
Save amysimmons/d0233466e5614e724aa50ff4190be7bb to your computer and use it in GitHub Desktop.
// A) Importing named exports  
import { foo, bar, baz } from 'utils';
// B) Importing and renaming a named export
import { foo as fooDelish } from 'utils';
// C) Importing the default export
import foo from 'utils';
// D) Importing and renaming the default export
import { default as fooDelish } from 'utils';
// E) Importing the default export and other named exports 
import foo, { bar, baz } from 'utils';
// F) Importing everything from a module into a single namespace  
import * as utils from 'utils';
utils.foo();
utils.bar();
utils.baz();
// G) Load, compile and evaluate the module (but don't import any members)
import 'utils';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment