Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why http module is not located in the node_modules folder?

Tags:

node.js

My question is what is the difference between http module and other modules in node.js . why is the http module not located in ./node_modules? Where I can find the module?

like image 680
sabbir Avatar asked Oct 27 '25 10:10

sabbir


1 Answers

The http module is provided by your installation of Node.js. It's what's known as a core module

You can view the source to them in the repo (or download them locally): https://github.com/nodejs/node/tree/master/lib

Update

As of Node 18 you can reference core modules by prefixing them with node:, which ensures you don't load a dependency that shares the same name.

const http = require('node:http');
like image 105
Joey Ciechanowicz Avatar answered Oct 28 '25 22:10

Joey Ciechanowicz