Comparing version
10
index.js
const fs = require('fs'); | ||
const tryOpen = require('try-open'); | ||
const exists = require('fs-exists-sync'); | ||
@@ -27,3 +27,3 @@ function isEmpty(path, fn, callback) { | ||
}); | ||
}; | ||
} | ||
@@ -40,10 +40,6 @@ isEmpty.sync = function(path, fn) { | ||
return files.length === 0; | ||
} catch (err) {}; | ||
} catch (err) {} | ||
return false; | ||
}; | ||
function exists(path) { | ||
return path && typeof tryOpen(path, 'r') === 'number'; | ||
} | ||
module.exports = isEmpty; |
{ | ||
"name": "empty-dir", | ||
"description": "Check if a directory is empty.", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/tkellen/js-empty-dir", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/js-cli/js-empty-dir", | ||
"author": "Tyler Kellen <http://goingslowly.com/>", | ||
"repository": "tkellen/js-empty-dir", | ||
"repository": "js-cli/js-empty-dir", | ||
"bugs": { | ||
"url": "https://github.com/tkellen/js-empty-dir/issues" | ||
"url": "https://github.com/js-cli/js-empty-dir/issues" | ||
}, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"files": ["index.js"], | ||
"files": [ | ||
"index.js" | ||
], | ||
"engines": { | ||
@@ -21,3 +23,3 @@ "node": ">= 0.8.0" | ||
"dependencies": { | ||
"try-open": "^0.1.0" | ||
"fs-exists-sync": "^0.1.0" | ||
}, | ||
@@ -24,0 +26,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
# empty-dir [](http://travis-ci.org/tkellen/js-empty-dir) | ||
# empty-dir [](http://travis-ci.org/js-cli/js-empty-dir) | ||
> Check if a directory is empty. | ||
@@ -3,0 +3,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3884
-1.82%36
-7.69%3
50%1
Infinity%+ Added
+ Added
- Removed
- Removed