find-file-up
Advanced tools
Comparing version 0.1.1 to 0.1.2
15
index.js
@@ -17,4 +17,3 @@ /*! | ||
var resolve = require('resolve-dir'); | ||
var existsSync = require('try-open'); | ||
var cwd = process.cwd(); | ||
var existsSync = require('fs-exists-sync'); | ||
@@ -65,3 +64,3 @@ /** | ||
if (existsSync(fp, 'r')) { | ||
if (existsSync(fp)) { | ||
return path.resolve(fp); | ||
@@ -76,3 +75,3 @@ } | ||
var filepath = path.resolve(dir, filename); | ||
if (existsSync(filepath, 'r')) { | ||
if (existsSync(filepath)) { | ||
return filepath; | ||
@@ -88,5 +87,3 @@ } | ||
/** | ||
* Returns true if a file exists. `fs.exists` | ||
* and `fs.existsSync` are deprecated. | ||
* | ||
* Returns true if a file exists. `fs.exists` and `fs.existsSync` are deprecated. | ||
* See: https://nodejs.org/api/fs.html#fs_fs_exists_path_callback | ||
@@ -96,6 +93,6 @@ */ | ||
function exists(filepath, cb) { | ||
fs.open(filepath, 'r', function(err) { | ||
(fs.access || fs.stat)(filepath, function(err) { | ||
if (err && err.code === 'ENOENT') { | ||
cb(false); | ||
return | ||
return; | ||
} | ||
@@ -102,0 +99,0 @@ if (err) { |
{ | ||
"name": "find-file-up", | ||
"description": "Find a file, starting with the given cwd and recursively searching up one directory until it's found (or we run out of directories). Async and sync.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/find-file-up", | ||
@@ -23,8 +23,9 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"resolve-dir": "^0.1.0", | ||
"try-open": "^0.1.0" | ||
"fs-exists-sync": "^0.1.0", | ||
"resolve-dir": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"delete": "^0.2.1", | ||
"mocha": "*" | ||
"delete": "^0.3.2", | ||
"gulp-format-md": "^0.1.9", | ||
"mocha": "^2.5.3" | ||
}, | ||
@@ -37,2 +38,10 @@ "keywords": [ | ||
"verb": { | ||
"toc": false, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"related": { | ||
@@ -42,10 +51,15 @@ "list": [ | ||
"load-pkg", | ||
"look-up", | ||
"module-root" | ||
"findup-sync", | ||
"find-pkg", | ||
"global-prefix", | ||
"global-modules" | ||
] | ||
}, | ||
"plugins": [ | ||
"gulp-format-md" | ||
] | ||
"reflinks": [ | ||
"verb" | ||
], | ||
"lint": { | ||
"reflinks": true | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality 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
4239
3
3
80
1
0
3
+ Addedfs-exists-sync@^0.1.0
+ Addedfs-exists-sync@0.1.0(transitive)
- Removedtry-open@^0.1.0
- Removedtry-open@0.1.3(transitive)