lib/fs-utils.js
function hasAttr(fs, path, attr, callback) {
  fs.getxattr(path, attr, function(err, attrVal) {
    // File doesn't exist locally at all
    if(err && err.code === 'ENOENT') {
      return callback(null, false);
    }

    // Deal with unexpected error
    if(err && err.code !== 'ENOATTR') {
      return callback(err);
    }

    callback(null, !!attrVal);
  });
}
function hasAttr(fs, path, attr, callback) {
  fs.getxattr(path, attr, function(err, attrVal) {
    // File doesn't exist locally at all
    if(err && err.code === 'ENOENT') {
      return callback(null, false);
    }

    // Deal with unexpected error
    if(err && err.code !== 'ENOATTR') {
      return callback(err);
    }

    callback(null, !!attrVal);
  });
}
function hasAttr ( fs , path , attr , callback ) { fs . getxattr ( path , attr , function ( err , attrVal ) { // File doesn't exist locally at all if ( err && err . code === 'ENOENT' ) { return callback ( null , false ) ; } // Deal with unexpected error if ( err && err . code !== 'ENOATTR' ) { return callback ( err ) ; } callback ( null , ! ! attrVal ) ; } ) ; }
See if a given path a) exists, and whether it is marked with an xattr.
See if a given path a ) exists and whether it is marked with an xattr .