Skip to content

Instantly share code, notes, and snippets.

@fay-jai
Created April 4, 2016 03:21
Show Gist options
  • Save fay-jai/d70d85c337b8054d955a2f9784c452d6 to your computer and use it in GitHub Desktop.
Save fay-jai/d70d85c337b8054d955a2f9784c452d6 to your computer and use it in GitHub Desktop.
Exploring Typescript Internal and External Modules
import * as SomeModule from "./module1";
import * as AnotherModule from "./module2";
console.log(SomeModule.sayHello("Willson"));
console.log(AnotherModule.add(1, 2, 3, 4));
/*
NOTE: this is the compiled JavaScript, assuming CommonJS module format
"use strict";
var SomeModule = require("./module1");
var AnotherModule = require("./module2");
console.log(SomeModule.sayHello("Willson"));
console.log(AnotherModule.add(1, 2, 3, 4));
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment