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·34 readsES6
CHIRAG KUMARhelpichirag.hashnode.dev·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·31 readsnpm
Zihan Linkuruxxii.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 are private and not visible to other files. Inside each module, the m...Discuss·1 like·47 readsJavaScript
Mertcan Yurttaşmertcanyurttas.hashnode.dev·Dec 7, 2023How to Add Autoprefix to CSS CodesUntil gulp-autoprefixer v8.0.0, we could include the gulp-autoprefixer module in our gulp file with the require command. const gulp = require("gulp"); const autoprefixer = require("gulp-autoprefixer"); // Define the autoprefixer task gulp.task("auto...Discussautoprefix
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·133 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
Satyam Sundaramsatyamsundaram.hashnode.dev·Sep 13, 2022ES6 vs CommonJS modules explainedFor starters, let us understand what ES6 and CommonJS are, as well as their history. ES6 stands for ECMAScript 6. ECMAScript was created to standardize JavaScript. CommonJS is a project with the goal to establish conventions on the module ecosystem ...Discuss·10 likes·339 readsES6
Mike Mwanjemikemwanje.hashnode.dev·Aug 28, 2021How different is CommonJs require from ES6 import?In JavaScript, you can use either ECMAScript 6(ES6) modules or CommonJs modules in your project and there are a few differences between these that do affect how your program modules are loaded. In this article, I explore how each works and how it may...Discuss·196 readsJavaScript