sindresorhus/tempy







The issue has been solved
Add ability to easily cleanup #11
sindresorhus posted onGitHub
Offer both cleanup when the process exits, manual cleanup method call, and also a context-based cleanup, for examples:
tempy.context(directory => {
// Use the temp
});
// Temp directory is cleaned up here.
(The temp directory is cleaned up after the callback scope.)
(The above is just an idea. Please consider a better API and naming.)
(The context callback should also be able to be an async
function.)
Inspiration: Python Context Managers
If you decide to work on this, please put a good effort into the implementation, docs (and TS definition), and tests.
Fund this Issue
Rewarded pull request
Add cleanup methods #25submitted byrichienb(180)
Other pull requests
Click to copy link
Recent activities