6

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 1

5

https://nodejs.org/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.com/package/temp-dir

Not the answer you're looking for? Browse other questions tagged or ask your own question.