docs: function markdownToJSON (configArg, name, transform) {
    var config;
  
    if (typeof configArg === 'function') {
      config = {
        renderer: configArg
      };
  
      if (typeof name === 'string') config.name = name;
      if (typeof name === 'function') config.transform = name;
      if (typeof transform === 'function') config.transform = transform;
    } else {
      config = configArg;
    }
  
    const stream = through.obj(function (input, enc, callback) {
      if (!config.renderer || typeof config.renderer !== 'function') return callback(pluginError('Markdown renderer function required'));
  
      const isBuffered = Array.isArray(input); // as created by list-stream
  
      const queue = (isBuffered)
        ? input.map(file => isBinary(file))
        : [isBinary(input)];
  
      Promise.all(queue)
        .then(files => Promise.resolve(files.filter(file => file.isText)))
        .then(files => Promise.all(files.map(file => toJSON(file, config))))
        .then(files => {
          const invalidFiles = files.filter(file => file.isInvalid);
          const validFiles = files.filter(file => !file.isInvalid);
  
          invalidFiles.forEach(file => stream.emit('error', pluginError(`${Path.basename(file.basename)} is not valid JSON`)));
  
          if (isBuffered) return consolidateFiles(validFiles, config);
  
          validFiles.forEach(file => stream.push(file));
        })
        .then(consolidatedFile => {
          if (consolidatedFile) stream.push(consolidatedFile);
          callback();
        })
        .catch(err => callback(pluginError(err)));
    });
  
    return stream;
  }