In Node.js, global objects are accessible throughout any application. You can use these objects at any point in a Node.js application. These objects can contain information about the application or filesystem. The following global objects are used most often in Node.js applications:
console.log(__dirname); >> /Users/Jon/Desktop
console.log(__filename); >> /Users/Jon/Desktop/filename_example.js
Some objects appear to be similar to the Node.js global objects but come from other libraries required into your project. These objects are available in most Node.js applications. As you learn to work with the following objects, their use cases will make more sense:
exports.accessibleFunction = () => { console.log("hello!"); }
const http = require("http");