node杂谈 已注销 2018-05-18 87 阅读1分钟 process.cwd() //获取当前的工作目录 var str = fs.realpathSync('.'); //根据参数获得目录的绝对路径 //其中起始目录为当前工作目录 console.log(str);