最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get the Temporary file directory path of the underlying Operating System in node.js? - Stack Overflow

programmeradmin2浏览0评论

Is there some built-in way to get the path to the "temporary file directory" (i.e. /tmp in a majority of *nix, the directory pointed to by %temp% in Windows) either as a function or a variable, or is there some module I need to download in order to achieve the same effect?

Is there some built-in way to get the path to the "temporary file directory" (i.e. /tmp in a majority of *nix, the directory pointed to by %temp% in Windows) either as a function or a variable, or is there some module I need to download in order to achieve the same effect?

Share Improve this question edited Sep 29, 2023 at 9:08 Atlas Sullivan asked Sep 29, 2019 at 15:10 Atlas SullivanAtlas Sullivan 1891 silver badge11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

https://nodejs/api/os.html#os_os_tmpdir

But there is a problem on macOS because temp directory is symlink and os.tmpdir() is returning the symlink path. If you want to get real path on all systems (including macOS) you can use this package: https://www.npmjs./package/temp-dir

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论