Skip to content

Instantly share code, notes, and snippets.

@Psvensso
Created September 24, 2015 11:43
Show Gist options
  • Save Psvensso/39b0c71602c2f8f3060e to your computer and use it in GitHub Desktop.
Save Psvensso/39b0c71602c2f8f3060e to your computer and use it in GitHub Desktop.
import 'jquery'; // import a module without any import bindings
import $ from 'jquery'; // import the default export of a module
import { $ } from 'jquery'; // import a named export of a module
import { $ as jQuery } from 'jquery'; // import a named export to a different name
export var x = 42; // export a named variable
export function foo() {}; // export a named function
export default 42; // export the default export
export default function foo() {}; // export the default export as a function
export { encrypt }; // export an existing variable
export { decrypt as dec }; // export a variable as a new name
export { encrypt as en } from 'crypto'; // export an export from another module
export * from 'crypto'; // export all exports from another module
import * as crypto from 'crypto'; // import an entire module instance object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment