code: function fsCmd(cmd, sync) {
      var d, args = Array.prototype.slice.call(arguments, 2);
      if (sync) {
          d = Q.defer();
          try {
              d.resolve(fs[cmd + 'Sync'].apply(fs, args));
          } catch (e) {
              d.reject(e);
          }
          return d.promise;
      }
      return Q.ninvoke.apply(Q, [fs, cmd].concat(args));
  }
docs: Present the same Q interface for both sync/non-sync versions of fs commands.