Ariska Hidayattech.finlup.id·Dec 9, 2024CommonJS vs ES Modules: Perbandingan Lengkap, Kelebihan, Kekurangan, dan Kapan MenggunakannyaKelebihan dan Kekurangan CommonJS (CJS) Kelebihan: Mature dan Stabil CommonJS telah digunakan secara luas di Node.js sejak awal, sehingga didukung secara luas oleh ekosistem Node.js. Eksekusi Dinamis Anda dapat mengimpor modul secara dinamis dengan...commonjs
Gemma Blackgemmablack.dev·Nov 17, 2024Node.js: using fs.watch to re-import CommonJS modules.Disclaimer. This is an investigation into what is possible. Not a fully-blown solution into how to reload modules without restarting the whole server. In a previous article, I was investigating how to use require.cache to refresh a module by deletin...169 readsfs.watch
Gemma Blackgemmablack.dev·Nov 17, 2024Node.js: refreshing a module using require.cacheThis is purely in reference to CommonJS modules. TLDR Before I bore you with why I did this, refreshing a module can be done by deleting its reference in the require.cache object. Like so: require('./some-module') // use module delete require.cach...require.cache
Dana Ciocandanaciocan.com·Nov 5, 2024Why are there so many types of JavaScript modules?Let’s cast our minds back to 1995. Netscape Navigator was the predominant browser folks were using to get their internet fix (if at all - there was certainly no guarantee you had the internet at home back then!) and connecting to the internet sounded...2 likes·35 readsJavaScript
Nirmal Sankalananirmalsankalana.hashnode.dev·Aug 11, 2024Understanding CJS and ESM Imports and ExportsAs JavaScript has evolved, its module system has also improved. Two primary module formats dominate the ecosystem: CommonJS (CJS) and ECMAScript Modules (ESM). Understanding these two formats is crucial for developers, especially when working with mo...10 likesJavaScript
Adegbite Moyomademadevblog.hashnode.dev·Aug 6, 2024CommonJS vs ES6 Modules: A Developer's JourneyAs I've delved deeper into JavaScript development, I've come to realize that understanding module systems is crucial. Trust me, wrapping your head around CommonJS and ES6 modules isn't just academic—it's key to truly grasping how modern JavaScript wo...2 likesJavaScript
JoLoblog.jolo.dev·Jul 12, 2024Oh CommonJS! Why are you mESMing with me?!It was a normal patching day. I patched and upgraded my npm dependencies without making code changes, and suddenly, some of my unit tests failed. Wtf! My tests failed because Jest encountered an unexpected token; they failed because Jest cannot han...31 readsesm
Syed Muhammad Yaseensmy.hashnode.dev·Jun 25, 2024TypeScript SDK Development: A 5-year-old could follow this step-by-step ~ Part 1, our first MVPHelloooooooo! Hope you're doing great! This is SMY! 👋 Let's Jump right in 🚀 Part 2: https://smy.hashnode.dev/typescript-sdk-development-a-5-year-old-could-follow-this-step-by-step-part-2-folder-structure-integrating-api Part 3: https://smy.hashnode...52 readsTypeScript SDK Developmentsdk
Gautam VajaforCodeParrot 10x Dev10xdev.codeparrot.ai·Feb 10, 2024require Vs import: Old Vs New war in Javascriptimporting a module is a fundamental concept that refers to the process of bringing one module's code into another module. Think of it as borrowing a book from a library; you don't need to own every book, you just borrow what you need when you need it...10 likes·127 readsES6
CHIRAG KUMARichiragkumar.tech·Jan 28, 2024ES6 vs Common Javascript in node jslearn about Es6 modules and common js, after this no doubt ES6 modules are asynchronous loaded while, Common js modules are synchronous loaded How to work with common js const fs = require("fs") const fd = rs.readFileSync("filename.txt", "utf-8"...Node.js