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?
1 Answer
Reset to default 5https://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