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...
This 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...
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...
As 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...
As 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...
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...
Helloooooooo! 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...
importing 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...
learn 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"...
In 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...