CommonJS was a great invention but nowadays we have something better called ECMAScript Modules (ESM). Learn in this tutorial how to upgrade your TypeScript projects to ESM.
*My FREE programming apps:*
- [ Ссылка ]
- [ Ссылка ]
*My FREE TypeScript Course:*
- [ Ссылка ]
Timeline:
00:00 - Intro
00:31 - Understanding Scripts and Modules
01:38 - CommonJS: Exports and Imports
03:31 - HTML: Exports and Imports
06:14 - ESM: Exports and Imports
08:56 - Asynchronous Loading
10:08 - Enabling ESM in Node.js
11:21 - New Module File Extensions
12:25 - Network-based Module Loading
13:15 - TypeScript with Node: Using ESM
15:05 - TypeScript with Browsers: Using ESM
15:58 - When to Use ESNext
16:40 - When to Use NodeNext
17:34 - Import Attributes in TypeScript
18:00 - ESM Cheat Sheet Overview
20:13 - Using the import.meta API
20:36 - Why ESM is the Future
#TypeScript #JavaScript #nodejs
Ещё видео!