fileEventEmitter

  • function
 

Processes a file's source. Adds created docObjects to docMap.

documentjs.process.file(source, docMap, [filename])

Processes files "matched" from a file event emitter into a docMap.

Parameters

  1. fileEventEmitter {fileEventEmitter}

    An event emitter that dispatches events with files to process.

  2. options {Object}

    An options object used to configure the behavior of documentjs.

    • tags {String}

      If tags is a string, that file will be required. It should export a function that takes the default tags object and returns the tags that will be used. Example module:

      module.exports = function(tags) {
             tags = _.extend({},tags);
          tags.customTag = {add: function(){}, ...}
          return tags;
      };
      

Returns

{Promise<docMap>}

A docMap that contains the docObjects created from the matched files.