// The directory of current file
console.log('__dirnameļ¼', __dirname)
// The directory including file name of current file
console.log('__filenameļ¼', __filename)
// The directory of the main file running
console.log('process.cwd()ļ¼', process.cwd())
// __dirnameļ¼ C:\Users\Dylanliu\Desktop\test\nodejs
// __filenameļ¼ C:\Users\Dylanliu\Desktop\test\nodejs\path.js
// process.cwd()ļ¼ C:\Users\Dylanliu\Desktop\test\nodejs
Path resolve vs Path join
For showing the path of . or .., it is preferred to use path resolve
For joining the path, it is preferred to use path join