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...Discuss·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...Discuss·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...Discussesm
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...Discuss·47 readssdk
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...Discuss·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"...DiscussNode.js
Ijlal Ahmadijlalahmad.hashnode.dev·Jan 15, 2024Crafting Hybrid NPM Packages with TypeScript: A Comprehensive GuideIn this article, I'll walk you through the process of achieving a hybrid nature for npm packages, drawing from my own experiences and addressing potential challenges that may arise. I'll assume that you have a basic understanding of deploying npm pac...Discuss·57 readsnpm
Zihan Linzihanlin.hashnode.dev·Jan 6, 2024Basic Usage of CommonJS and ECMAScript ModulesCommonJS CommonJS modules are the original way to package JavaScript code for Node.js. Each file is a module with its own scope. Variables, functions, and classes defined in a file ar e private and not visible to other files. Inside each module, th...Discuss·1 like·51 readsJavaScript
Christian Bates-Whitewhitecx.hashnode.dev·Mar 1, 2023How I Escaped Refactoring Hell with Dynamic Imports (NodeJS x NPM)Big Ideas: Legacy code may need refactoring as dependencies start leveraging ES Modules Avoid changing an entire application over to ES Modules w/ Dynamic Imports Dynamic Imports can reduce code refactor size dramatically The Story: Let's set th...Discuss·1 like·57 readsNode.js
Joseph Ganbwgjoseph.com·Oct 6, 2022Understanding export and import in CommonJSI'm pretty sure this is not the first time that I got confused by the various exports' syntax in CommonJS and definitely will not be the last. Hence, this article will hopefully be useful for my future self whenever I need a reference. Scenario Consi...Discuss·135 readsJavaScript