1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Replace file-exists.js with NPM path-exists.

This commit is contained in:
hacksalot
2015-12-22 18:55:17 -05:00
parent dab6ebfd82
commit ebad1677bc
4 changed files with 3 additions and 21 deletions

View File

@ -1,19 +0,0 @@
/**
Definition of the `fileExists` method.
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
@module file-exists.js
*/
var FS = require('fs');
// Yup, this is now the recommended way to check for file existence on Node.
// fs.exists is deprecated and the recommended fs.statSync/lstatSync throws
// exceptions on non-existent paths :)
module.exports = function (path) {
try {
FS.statSync( path );
return true;
} catch( err ) {
return !(err && err.code === 'ENOENT');
}
};