Tmp
A simple temporary file and directory creator for node.js.
- @@ -84,7 +84,7 @@An Important Note on Previously Undocumented Breaking Changes
An Important Note on Compatibility
See the CHANGELOG for more information.
Version 0.2.2
-Since version 0.2.2, all support for node version < 12 has been dropped.
+Since version 0.2.2, all support for node version <= 12 has been dropped.
Version 0.1.0
Since version 0.1.0, all support for node versions < 0.10.0 has been dropped.
Most importantly, any support for earlier versions of node-tmp was also dropped.
@@ -338,7 +338,7 @@Home
Global
-
diff --git a/docs/tmp.js.html b/docs/tmp.js.html
index 4c2b003..1e4eb63 100644
--- a/docs/tmp.js.html
+++ b/docs/tmp.js.html
@@ -42,7 +42,6 @@
Source: tmp.js
const path = require('path'); const crypto = require('crypto'); const _c = { fs: fs.constants, os: os.constants }; -const rimraf = require('rimraf'); /* * The working inner variables. @@ -71,12 +70,32 @@Source: tmp.js
_removeObjects = [], // API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback - FN_RMDIR_SYNC = fs.rmdirSync.bind(fs), - FN_RIMRAF_SYNC = rimraf.sync; + FN_RMDIR_SYNC = fs.rmdirSync.bind(fs); let _gracefulCleanup = false; +/** + * Recursively remove a directory and its contents. + * + * @param {string} dirPath path of directory to remove + * @param {Function} callback + * @private + */ +function rimraf(dirPath, callback) { + return fs.rm(dirPath, { recursive: true }, callback); +} + +/** + * Recursively remove a directory and its contents, synchronously. + * + * @param {string} dirPath path of directory to remove + * @private + */ +function FN_RIMRAF_SYNC(dirPath) { + return fs.rmSync(dirPath, { recursive: true }); +} + /** * Gets a temporary file name. * @@ -807,7 +826,7 @@Home
Global