raszi / node-tmp

Temporary file and directory creator for node.js
MIT License
736 stars 92 forks source link

Optional env variable NODETMP for passing in a custom temporary directory that may or may not be located under the OS provided TMP directory #219

Closed silkentrance closed 4 years ago

silkentrance commented 4 years ago

Users may pass an additional environment variable to the process, named NODETMP which will point to an existing temporary file system object storage location.

If the variable is unset, tmp will fall back to the standard, os provided temporary directory.

The dir option can be kept, however, all paths specified that option are now relative to the resolved temporary directory, see #207.

silkentrance commented 4 years ago

this is considered redundant at best. one can always pass in a tmp directory via the process environment and use the dir option to have specific dirs underneath that tmp directory. so there is no need for yet another environment variable. (YAEV)

also, that way, temporary files and directories are still under the regime of the operating system and will be cleaned on system restart, if everything else fails, unless of course the provided temporary directory path is not managed by the operating system. (YMMV)