So, there are three different ways to refer to directories in Node.js; namely - dot notation (./ and ../), __dirname, and process.cwd(). While all of them might seem to refer to the same thing, they can become a source of confusion and bugs, if they are not understood well. Let's examine how they work.