Home What is the purpose of Node.js module.exports and how do you use it?
Reply: 0

What is the purpose of Node.js module.exports and how do you use it?

user668
1#
user668 Published in June 25, 2018, 4:09 am

What is the purpose of Node.js module.exports and how do you use it?

I can't seem to find any information on this, but it appears to be a rather important part of Node.js as I often see it in source code.

According to the Node.js documentation:

module

A reference to the current module. In particular module.exports is the same as the exports object. See src/node.js for more information.

But this doesn't really help.

What exactly does module.exports do, and what would a simple example be?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.549608 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO