node-temp icon indicating copy to clipboard operation
node-temp copied to clipboard

`track()` maintains global state

Open loveencounterflow opened this issue 3 years ago • 0 comments

If I'm not mistaken, using track() anywhere in the same process means that now all of your tempfiles will get automatically deleted prior to process exit, even in those parts of the program that never intended to remove temporary files. This could affect the mode of operation of any dependencies that happen to also use temp.

Also that one can not use cleanup() without having called track() is IMHO an unwarranted complication. I fail to see what the relevance of this for long-running processes is; if anything, you do want to reliably unlink temporary files in such processes as soon as they're not needed to reduce chances of filling up the disk.

loveencounterflow avatar Sep 25 '22 14:09 loveencounterflow