Today we'll talk about the JavaScript module system. We'll also look at the two systems we can use in Node: CommonJS (CJS) and ECMAScript Modules (ESM). We'll see their differences and how we can use both simultaneously.
Links:
CommonJS (CJS) documentation: https://nodejs.org/dist/latest-v16.x/...
ECMAScript Modules (ESM) documentation: https://nodejs.org/dist/latest-v16.x/...
CJS with ESM: https://nodejs.org/dist/latest-v16.x/...
0:00 Introduction
0:26 WHAT is a JavaScript module system and HOW does it work?
2:29 CommonJS (CJS)
6:45 REQUIRE Details
7:57 MODULE.EXPORTS Details
11:46 Importing External Libraries
18:11 Selecting the Module System
20:44 ECMAScript Modules (ESM)
28:44 Working with ESM and CJS
Want to stay up-to-date? 👌 Follow us on our social media! 👌
-Twitch: / desarrolloutil
-Instagram: / desarrolloutil
-Discord: / discord
-Twitter: / desarrollo_util