---
title: "Discussion on \"What Happens When You Import Anything in Node.js?\" | Hashnode"
description: "Discussion on \"What Happens When You Import Anything in Node.js?\". Ever wondered what really happens when you import a module in Node.js? How Node.js figures out where to find the file?"
url: "https://hashnode.com/posts/what-happens-when-you-import-anything-in-nodejs/67ca1f2549da688407de78cd"
---

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

Discussion

# [What Happens When You Import Anything in Node.js?](https://blog.hassanbahati.com/what-happens-when-you-import-anything-in-nodejs?utm_source=hashnode&utm_medium=feed)

Ever wondered what really happens when you import a module in Node.js? How Node.js figures out where to find the file?

Mar 6, 2025 · 5 min read · blog.hassanbahati.com  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#resolution](https://hashnode.com/tag/resolution)
-   [#nodemodules](https://hashnode.com/tag/nodemodules)

## Written by

[Hassan Bahati](https://hashnode.com/@HassanBahati)

@HassanBahati · Kampala, Uganda

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

Computer Scientist

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
