process.cwd() 当前执行程序的路径(执行命令行时候的路径,不是代码路径 例如 在根目录下执行 node ./xxx/xxx/a.js 则 cwd 返回的是 根目录地址 )
__dirname: 代码存放的位置
process.execPath: 当前执行的node路径(如:/bin/node)
DEMO:
console.log(process.execPath) console.log(__dirname) console.log(process.cwd())
moodle-quizsmith:AI Agent 工具实践指南
margo:AI Agent 工具实践指南
anima-prompt-naturalang:实践指南
gemini-antigravity-cli:实践指南
API-Sentinel:实践指南
LangAlpha:AI Agent 工具实践指南
惊魂双胞胎重制版
香肠派对
惊魂双胞胎MOD菜单
这不是冒险
美食大厨动物风味小镇
寿司餐厅3D
闲置邮局
农场之梦收获天堂村
航空帝国大亨2026