Returns a disposable object whose path
property holds the created directory path. When the object is disposed, the directory and its contents will be removed if it still exists. If the directory cannot be deleted, disposal will throw an error. The object has a remove()
method which will perform the same task.
<!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
For detailed information, see the documentation of fs.mkdtemp()
.
There is no callback-based version of this API because it is designed for use with the using
syntax.
The optional options
argument can be a string specifying an encoding, or an object with an encoding
property specifying the character encoding to use.