Knowing the scope of each can make things easier to remember.
process
is node
's global object, and .cwd()
returns where node is running.
__dirname
is module
's property, and represents the file path of the module. In node, one module resides in one file.
Similarly, __filename
is another module
's property, which holds the file name of the module.