process.cwd()


返回进程的当前工作目录。

console.log(`当前工作目录是: ${process.cwd()}`);

The process.cwd() method returns the current working directory of the Node.js process.

console.log(`Current directory: ${process.cwd()}`);