---
title: "Discussion on \"🚀 Day 6: CommonJS vs ES Modules — require() vs import\" | Hashnode"
description: "Discussion on \"🚀 Day 6: CommonJS vs ES Modules — require() vs import\". Learn how Node.js modules work with CommonJS and ES Modules, understand require() vs import, and know when to use each module system in modern Node.js applications."
url: "https://hashnode.com/posts/day-6-commonjs-vs-es-modules-require-vs-import/6a82c080528d04c30f624e33"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [🚀 Day 6: CommonJS vs ES Modules — require() vs import](https://codewithpatil.hashnode.dev/day-6-commonjs-vs-es-modules-require-vs-import?utm_source=hashnode&utm_medium=feed)

Learn how Node.js modules work with CommonJS and ES Modules, understand require() vs import, and know when to use each module system in modern Node.js applications.

Aug 17 · 8 min read · codewithpatil.hashnode.dev  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#nodejs-developer](https://hashnode.com/tag/nodejs-developer)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#esmodules](https://hashnode.com/tag/esmodules)
-   [#require](https://hashnode.com/tag/require)
-   [#import](https://hashnode.com/tag/import)
-   [#javascriptmodules](https://hashnode.com/tag/javascriptmodules)
-   [#modernjavascript](https://hashnode.com/tag/modernjavascript)
-   [#codewithpatil](https://hashnode.com/tag/codewithpatil)
-   [#learnwithcodewithpatil](https://hashnode.com/tag/learnwithcodewithpatil)
-   [#backendwithcodewithpatil](https://hashnode.com/tag/backendwithcodewithpatil)
-   [#nodearchitecture](https://hashnode.com/tag/nodearchitecture)
-   [#careergrowth](https://hashnode.com/tag/careergrowth)
-   [#developercommunity](https://hashnode.com/tag/developercommunity)
-   [#nodejstutorial](https://hashnode.com/tag/nodejstutorial)

## Written by

[Sumit Patil](https://hashnode.com/@codewithpatil)

@codewithpatil · Bangalore, India

  
[View profile](https://hashnode.com/@codewithpatil)

Building Tomorrow's Software, Today!

\# Hi, I'm Sumit Patil 👋 a Senior Backend Software Engineer with 7+ years of experience designing scalable backend systems and cloud-native applications. I specialize in Node.js, NestJS, TypeScript, GraphQL, PostgreSQL, MongoDB, AWS, Microservices, and DevOps. 🏆 Smart Gujarat for New India Hackathon Winner

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
