lib/file/access/index.js
function writable(file) {
  if (!exists(file)) {
    return writable(path.dirname(file));
  } else {
    try {
      fs.accessSync(file, fs.W_OK);
    } catch (e) {
      return false;
    }
    return true;
  }
}
function writable(file) {
  if (!exists(file)) {
    return writable(path.dirname(file));
  } else {
    try {
      fs.accessSync(file, fs.W_OK);
    } catch (e) {
      return false;
    }
    return true;
  }
}
function writable ( file ) { if ( ! exists ( file ) ) { return writable ( path . dirname ( file ) ) ; } else { try { fs . accessSync ( file , fs . W_OK ) ; } catch ( e ) { return false ; } return true ; } }
Check whether a file is writable or not
@function $file~writable
@param {string} file
@returns {boolean}
@example
// Check if 'conf/my.cnf' is writable by the current user
$file.writable('conf/my.cnf');
// => true
Check whether a file is writable or not