KKevin LockeUse fs.rm() instead of rimraf
| Files | Last commit | Last update |
|---|---|---|
Add generated docs folder | 9 years ago | |
update jsdoc | 6 years ago | |
update jsdoc | 6 years ago | |
Use fs.rm() instead of rimraf A regression occurred in 0.2.2 which can be reproduced using: ```js const assert = require('assert'); const tmp = require('tmp'); tmp.dir({ unsafeCleanup: true }, (err, path, cleanup) => { assert.ifError(err); cleanup(assert.ifError); }); ``` This works with 0.2.1. With 0.2.2 it fails with: /path/to/tmp/node-tmp/lib/tmp.js:358 return removeFunction(fileOrDirName, next || function() {}); ^ TypeError: removeFunction is not a function at _cleanupCallback (/path/to/tmp/node-tmp/lib/tmp.js:358:16) at /path/to/tmp/node-tmp/repro.js:5:3 at _dirCreated (/path/to/tmp/node-tmp/lib/tmp.js:207:7) at FSReqCallback.oncomplete (node:fs:192:23) This occurs because 00bb5b282faadfd45a4e76d3e05591ab42c71027 upgraded the rimraf dependency from ^3.0.0 to ^5.0.5 without handling the change to a `Promise`-based API in 4.0.0 (https://github.com/isaacs/rimraf/commit/a71e7f9afb2d508496d32186daa3126bff9b5ef6) or the removal of the default export in 5.0.0 (https://github.com/isaacs/rimraf/commit/c7a3fd4e7e299eb5ba27d913e1d4d04951eb661d). This commit fixes the issue by dropping the `rimraf` dependency in favor of `fs.rm({recursive: true})`. It also updates the nodejs engine version to 14.14, when `fs.rm()` was added. Fixes: 00bb5b282faa ("Update rimraf and drop old Node compatibility") Fixes: #295 Signed-off-by: Kevin Locke <kevin@kevinlocke.name> | 2 years ago | |
Use fs.rm() instead of rimraf A regression occurred in 0.2.2 which can be reproduced using: ```js const assert = require('assert'); const tmp = require('tmp'); tmp.dir({ unsafeCleanup: true }, (err, path, cleanup) => { assert.ifError(err); cleanup(assert.ifError); }); ``` This works with 0.2.1. With 0.2.2 it fails with: /path/to/tmp/node-tmp/lib/tmp.js:358 return removeFunction(fileOrDirName, next || function() {}); ^ TypeError: removeFunction is not a function at _cleanupCallback (/path/to/tmp/node-tmp/lib/tmp.js:358:16) at /path/to/tmp/node-tmp/repro.js:5:3 at _dirCreated (/path/to/tmp/node-tmp/lib/tmp.js:207:7) at FSReqCallback.oncomplete (node:fs:192:23) This occurs because 00bb5b282faadfd45a4e76d3e05591ab42c71027 upgraded the rimraf dependency from ^3.0.0 to ^5.0.5 without handling the change to a `Promise`-based API in 4.0.0 (https://github.com/isaacs/rimraf/commit/a71e7f9afb2d508496d32186daa3126bff9b5ef6) or the removal of the default export in 5.0.0 (https://github.com/isaacs/rimraf/commit/c7a3fd4e7e299eb5ba27d913e1d4d04951eb661d). This commit fixes the issue by dropping the `rimraf` dependency in favor of `fs.rm({recursive: true})`. It also updates the nodejs engine version to 14.14, when `fs.rm()` was added. Fixes: 00bb5b282faa ("Update rimraf and drop old Node compatibility") Fixes: #295 Signed-off-by: Kevin Locke <kevin@kevinlocke.name> | 2 years ago | |
Use fs.rm() instead of rimraf A regression occurred in 0.2.2 which can be reproduced using: ```js const assert = require('assert'); const tmp = require('tmp'); tmp.dir({ unsafeCleanup: true }, (err, path, cleanup) => { assert.ifError(err); cleanup(assert.ifError); }); ``` This works with 0.2.1. With 0.2.2 it fails with: /path/to/tmp/node-tmp/lib/tmp.js:358 return removeFunction(fileOrDirName, next || function() {}); ^ TypeError: removeFunction is not a function at _cleanupCallback (/path/to/tmp/node-tmp/lib/tmp.js:358:16) at /path/to/tmp/node-tmp/repro.js:5:3 at _dirCreated (/path/to/tmp/node-tmp/lib/tmp.js:207:7) at FSReqCallback.oncomplete (node:fs:192:23) This occurs because 00bb5b282faadfd45a4e76d3e05591ab42c71027 upgraded the rimraf dependency from ^3.0.0 to ^5.0.5 without handling the change to a `Promise`-based API in 4.0.0 (https://github.com/isaacs/rimraf/commit/a71e7f9afb2d508496d32186daa3126bff9b5ef6) or the removal of the default export in 5.0.0 (https://github.com/isaacs/rimraf/commit/c7a3fd4e7e299eb5ba27d913e1d4d04951eb661d). This commit fixes the issue by dropping the `rimraf` dependency in favor of `fs.rm({recursive: true})`. It also updates the nodejs engine version to 14.14, when `fs.rm()` was added. Fixes: 00bb5b282faa ("Update rimraf and drop old Node compatibility") Fixes: #295 Signed-off-by: Kevin Locke <kevin@kevinlocke.name> | 2 years ago |