Reputation: 125
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?
Upvotes: 4
Views: 628
Reputation: 3663
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
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');
Upvotes: 6
Reputation: 51
var http = require('http');
Upvotes: 2