Say goodbye to CommonJS and use ESM! 👋

TypeScript with Benny Code • June 4, 2024
Video Thumbnail
TypeScript with Benny Code Logo

TypeScript with Benny Code

View Channel

About

Learn programming with TypeScript for FREE. Subscribe for new episodes.

Video Description

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:* - https://apps.apple.com/app/id659282498 - https://play.google.com/store/apps/details?id=com.welovecoding.app *My FREE TypeScript Course:* - https://typescript.tv/ 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

You May Also Like