Skip to content Skip to sidebar Skip to footer

What Does Require() Actually Return, The File Or The Function

For example, I have profile.js var EventEmitter = require('events').EventEmitter; var https = require('https'); var http = require('http'); var util = require('util'); functio

Solution 1:

The require(...) function returns the module.exports value from the "required" module, and in the case its the Profile function.


As an aside, I have no idea what "return the file" or "the Profile is the profile.js itself" means.

Post a Comment for "What Does Require() Actually Return, The File Or The Function"