nodejs有没有类似JAVA的basePath的方法
 发布于 11 年前  作者 algz  4946 次预览  最后一次回复是 11 年前  来自  

nodejs有没有类似JAVA的basePath这样在当前页面获得项目路径的方法

2 回复
ShlXue

printf __dirname

yaochun

__dirname 属于Global Objects

The name of the directory that the currently executing script resides in.

注意:【the currently executing script】