code: function patch(obj, method, optionsArgIndex) {
      var orig = obj[method];
      if (!orig) return;
      obj[method] = function () {
        var opts = arguments[optionsArgIndex];
        var file = null;
        if (opts) {
          file = typeof opts == 'string' ? opts : opts.filename;
        }
        if (file) callback(file);
        return orig.apply(this, arguments);
      };
    }
docs: Patch the specified method to watch the file at the given argument
  index.