Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created September 10, 2017 03:44
Show Gist options
  • Save StevenJL/29e35c069c20531cdc8a49c70dc45813 to your computer and use it in GitHub Desktop.
Save StevenJL/29e35c069c20531cdc8a49c70dc45813 to your computer and use it in GitHub Desktop.
modules
// lib/math.js
export function sum(x, y) { return x + y; }
export var pi = 3.14159
// myApp.js
import {sum, pi} from "lib/math"
sum(pi, pi);
// otherApp.js
import * as math from "lib/math"
sum(pi, pi);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment