Create and remove temporary directories with minimal effort
Create and remove temporary directories. Useful for build tools, like Broccoli
plugins. Smart about naming, and placing them in
./tmp if possible, so you
don't have to worry about this.
npm install --save quick-temp
var quickTemp = require'quick-temp'
To make a temporary and assign its path to
this.tmpDestDir, call either one
quickTempmakeOrRemakethis 'tmpDestDir'// orquickTempmakeOrReusethis 'tmpDestDir'
this.tmpDestDir already contains a path,
makeOrRemake will remove it
first and then create a new directory, whereas
makeOrReuse will be a no-op.
Both functions also return the path of the temporary directory.
To remove a previously-created temporary directory and all its contents, call
This will also assign
this.tmpDestDir = null. If
already null or undefined, it will be a no-op.