Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit a574809

Browse files
author
Andy Hanson
committed
Elaborate
1 parent d0a9bb2 commit a574809

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pages/Modules.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ x(y);
519519

520520
### UMD modules
521521

522-
Some libraries can be used either through imports or through globals.
522+
Some libraries are designed to be used in many module loaders, or with no module loading (global variables).
523+
These are known as [UMD](https://github.com/umdjs/umd) or [Isomorphic](http://isomorphic.net) modules.
524+
These libraries can be accessed through either an import or a global variable.
525+
For example:
523526

524527
##### math-lib.d.ts
525528

@@ -536,7 +539,8 @@ isPrime(2);
536539
mathLib.isPrime(2); // ERROR: can't use the global definition from inside a module
537540
```
538541

539-
It can also be used as a global variable, but only inside of a script:
542+
It can also be used as a global variable, but only inside of a script.
543+
(A script is a file with no imports or exports.)
540544

541545
```ts
542546
mathLib.isPrime(2);

0 commit comments

Comments
 (0)