* Creates a unique temporary directory asynchronously. * @param {string} prefix The prefix for the temp directory * @param {object|Function} [options] Options or callback * @param {Function} [callback] Callback (err, dirPath)
(prefix, options, callback)
| 955 | * @param {Function} [callback] Callback (err, dirPath) |
| 956 | */ |
| 957 | mkdtemp(prefix, options, callback) { |
| 958 | if (typeof options === 'function') { |
| 959 | callback = options; |
| 960 | options = undefined; |
| 961 | } |
| 962 | try { |
| 963 | const dirPath = this.mkdtempSync(prefix); |
| 964 | process.nextTick(callback, null, dirPath); |
| 965 | } catch (err) { |
| 966 | process.nextTick(callback, err); |
| 967 | } |
| 968 | } |
| 969 | |
| 970 | /** |
| 971 | * Opens a directory asynchronously. |