file-exists
Advanced tools
Comparing version 1.0.0 to 2.0.0
13
index.js
@@ -13,6 +13,13 @@ var fs = require('fs') | ||
try { | ||
return fs.statSync(fullpath).isFile() | ||
} catch (e) { | ||
return false | ||
return fs.statSync(fullpath).isFile(); | ||
} | ||
catch (e) { | ||
// Check exception. If ENOENT - no such file or directory ok, file doesn't exist. | ||
// Otherwise something else went wrong, we don't have rights to access the file, ... | ||
if (e.code != 'ENOENT') | ||
throw e; | ||
return false; | ||
} | ||
} |
{ | ||
"name": "file-exists", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Check if filepath exists and is a file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3932
33