node_api_get_module_file_name
NAPI_EXTERN napi_status
node_api_get_module_file_name(node_api_basic_env env, const char** result);
-
[in] env
:调用 API 的环境。¥
[in] env
: The environment that the API is invoked under. -
[out] result
:包含加载项加载位置的绝对路径的 URL。对于本地文件系统上的文件,它将以file://
开头。该字符串以 null 结尾并归env
所有,因此不得修改或释放。¥
[out] result
: A URL containing the absolute path of the location from which the add-on was loaded. For a file on the local file system it will start withfile://
. The string is null-terminated and owned byenv
and must thus not be modified or freed.
如果加载项加载过程无法在加载期间建立加载项的文件名,则 result
可能是一个空字符串。
¥result
may be an empty string if the add-on loading process fails to establish
the add-on's file name during loading.