Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the purpose of module.exports in Node.js?
Home
Node.js Essentials
What is the purpose of module.exports in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
What is the purpose of
module.exports
in Node.js?
#node
js-purpose
#module
exports-node
js
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 31, 2020
by
SakshiSharma
A module encapsulates related code into a single unit of code. This can be interpreted as moving all related functions into a file. Imagine that we created a file called greetings.js and it contains the following two
Related questions
+1
vote
Q: What are some of the most popular modules of Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-popular-modules
js-modules
#modules-node
js
+1
vote
Q: What is Streams in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-streams
#streams-node
js
+1
vote
Q: What is EventEmitter in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-eventemitter
#eventemitter-node
js
+1
vote
Q: What is libuv in Node.JS
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-libuv
#libuv-node
js
+1
vote
Q: How will you debug an application in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-debug
#debug-node
js
+1
vote
Q: What is Tracing in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-tracing
#tracing-node
js
0
votes
Q: What is REPL in Node.js?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-repl
#repl
#repl-node
js
0
votes
Q: What is Event loop in Node.js work? And How does it work?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-loop
js-work
#use-node
js
js-advantages
+1
vote
Q: What is Node.js? What is it used for?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#what-is-node
js
#node
js-use
+1
vote
Q: What is Node.Js or Node,JS Tutorial?
asked
May 30, 2020
in
Node.js Essentials
by
SakshiSharma
#node
js
#what-is-node
+1
vote
Q: What is package.json in node.js? What is it used for?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#package
json
#json-package
#node
js-package
+1
vote
Q: What is process.nextTick() in Node.JS
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-process
nexttick
+1
vote
Q: Difference between setImmediate() vs setTimeout() in Node.JS
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-setimmediate
js-settimeout
js-functions
+1
vote
Q: What is the difference between Asynchronous and Non-blocking in Node.JS?
asked
May 31, 2020
in
Node.js Essentials
by
Robindeniel
#node
js-asynchronous-blocking
#non-blocking
js-blocking
0
votes
Q: For Node.js, the _____ module and its dependencies are designed.
asked
Aug 15, 2021
in
APIGEE - API Services
by
sharadyadav1986
node
js
dependencies
...