lib/auto-generate.js
function fileExists(file) {
    try {
        var targetStat = fs.statSync(file);
        if (targetStat.isDirectory() ) {
            throw new Error("File exists but it's a driectory: " + file);
        }
    }
    catch(err) {
        if (err.code == 'ENOENT') {         // No such file or directory
            return false;
        }
        else {
            throw err;
        }
    }
    return true;
}
function fileExists(file) {
    try {
        var targetStat = fs.statSync(file);
        if (targetStat.isDirectory() ) {
            throw new Error("File exists but it's a driectory: " + file);
        }
    }
    catch(err) {
        if (err.code == 'ENOENT') {         // No such file or directory
            return false;
        }
        else {
            throw err;
        }
    }
    return true;
}
function fileExists ( file ) { try { var targetStat = fs . statSync ( file ) ; if ( targetStat . isDirectory ( ) ) { throw new Error ( "File exists but it's a driectory: " + file ) ; } } catch ( err ) { if ( err . code == 'ENOENT' ) { // No such file or directory return false ; } else { throw err ; } } return true ; }
Checks if the file exists at the given path. Returns true if it exists, false otherwise.
@private
@param {string} file - Path of the file to check
@returns {boolean}
Checks if the file exists at the given path . Returns true if it exists false otherwise .