Creates a temporary folder inside CWD and passes the path to a function. Afterwards, the folder is removed. Especially useful for testing.
# NPM$ npm install with-local-tmp-dir# Yarn$ yarn add with-local-tmp-dir
const withLocalTmpDir =await// Now the folder does not exist anymore// Also works with async functions =)await// The folder is removed even if an exception is thrownawait// Create the temporary folder in a specific pathawait// Keep folder if not emptyawait
Unless stated otherwise all works are:
Copyright © Sebastian Landwehr email@example.com
and licensed under: