Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8'
is used.
Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8'
is used.
Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
Creates a unique temporary directory.
Generates six random characters to be appended behind a required
prefix
to create a unique temporary directory. Due to platform inconsistencies, avoid trailingX
characters inprefix
. Some platforms, notably the BSDs, can return more than six random characters, and replace trailingX
characters inprefix
with random characters.The created directory path is passed as a string to the callback's second parameter.
The optional
options
argument can be a string specifying an encoding, or an object with anencoding
property specifying the character encoding to use.The
fs.mkdtemp()
method will append the six randomly selected characters directly to theprefix
string. For instance, given a directory/tmp
, if the intention is to create a temporary directory within/tmp
, theprefix
must end with a trailing platform-specific path separator (require('path').sep
).Since
v5.10.0