user4776653
user4776653

Reputation:

Node module dependency

I am new to Nodejs and javascript and not sure yet how to ask the right question. My main file has a var express = require('express'); on top of it. I am also creating a module that I will be requiring in my main file. I know that module also require the express module. Do I have to import the express module into it or the main file will take care of that?

Upvotes: 0

Views: 48

Answers (1)

Felix Kling
Felix Kling

Reputation: 816374

Modules are completely self contained. Every module has to import the dependencies it needs.

Upvotes: 3

Related Questions