madge
Version:
Create graphs from module dependencies.
17 lines (14 loc) • 468 B
JavaScript
// == `math.js` == //
// This function is exported, so it's available for other modules to import
export function add(num1: number, num2: number): number {
return num1 + num2;
};
// This function isn't exported, so it's only available in the local scope
// of this module
function sub(num1, num2) {
return num1 - num2;
}
// Note that we can use both exported and non-exported items within this
// module
var two: number = add(1, 2);
var one: number = sub(2, 1);