fs-extra-p
Advanced tools
Comparing version 8.0.0 to 8.0.1
21
index.js
"use strict" | ||
const path = require("path") | ||
const nodeFs = require("fs") | ||
const fsExtra = require("fs-extra") | ||
@@ -35,2 +37,19 @@ const Promise = require('bluebird-lst') | ||
module.exports = makeFs(Promise) | ||
const newFs = makeFs(Promise) | ||
newFs.emptyDir = function (dir) { | ||
return new Promise((resolve, reject) => { | ||
nodeFs.readdir(dir, (error, files) => { | ||
if (error == null) { | ||
Promise.map(files, it => newFs.remove(path.join(dir, it))) | ||
.then(resolve) | ||
.catch(reject) | ||
} | ||
else { | ||
reject(error) | ||
} | ||
}) | ||
}) | ||
} | ||
module.exports = newFs |
{ | ||
"name": "fs-extra-p", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"description": "fs-extra module promisified with bluebird", | ||
@@ -8,4 +8,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird-lst": "^1.0.8", | ||
"fs-extra": "^8.0.0" | ||
"bluebird-lst": "^1.0.9", | ||
"fs-extra": "^8.0.1" | ||
}, | ||
@@ -12,0 +12,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10789
166
3
Updatedbluebird-lst@^1.0.9
Updatedfs-extra@^8.0.1