CNode

nodejs有没有类似JAVA的basePath的方法

Aalgz发布于12 年前最后回复12 年前2 回复5083 浏览0 收藏

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

查看回复

回复 (2)

Y
yaochun#1·12 年前

__dirname 属于Global Objects

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

注意:【the currently executing script】

S
ShlXue#2·12 年前

printf __dirname

参与回复
登录后即可参与回复。登录