A.11. Modules
In any programming language, splitting code into modules helps organize the application into logical and possibly reusable units. Modularized applications allow programming tasks to be split between software developers more efficiently. Developers of modules get to decide which APIs should be exposed by the module for external use and which should be used internally.
ES5 doesn’t have language constructs for creating modules, so we have to resort to one of these options:
- Manually implement a module design pattern as an immediately initialized function.
- Use third-party module implementations, such as the asynchronous module definition (AMD; http://mng.bz/JKVc) or CommonJS (http://mng.bz/7Lld) standard.
CommonJS was created for ...
Get TypeScript Quickly now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.