You will only use node app.js, which means you will run only one file. But you will split your code in modules.
Basic example of function in single file.

Now, wouldn’t it make sense if the names are in seperate file as well as this function or the future functions are in seperate files and we can access them all throughout the application. This is exactly what modules allow us to do.
Similar to ES6 modules in JS. This is for encapsulated code. It shares only minimum. Since, node uses common js under the hood, every file in node is a module. So, we don’t need to do anything new.
Example:
First we will make 3 files:
Now if we log the module. We get:

What we are interested in, is exports object. And the way the common js works is that anything I am going to dump in exports I can use anywhere in the application. So, as we know we are only sharing the minimum. So, it is upto us what goes in the exports object.