Skip to content

Instantly share code, notes, and snippets.

@antonioiksi
Created November 6, 2017 20:41
Show Gist options
  • Save antonioiksi/af669122c2f62d3636f2c6220cd93010 to your computer and use it in GitHub Desktop.
Save antonioiksi/af669122c2f62d3636f2c6220cd93010 to your computer and use it in GitHub Desktop.
replace require with import and vv
The syntax for importing a member of a module with an aliased name is:
import {key as foo} from 'bar';
This is equivalent to var foo = require('bar').key;
If you want to import a member without aliasing it, the syntax is simpler:
import {foo} from 'bar';
Is equivalent to:
var foo = require('bar').foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment