code: function init(){
      var output;
      var components = [];
  
      // write stream to output file
      if(options.output){
  
        // create directory if it doesn't exist
        mkdirp.sync(path.dirname(options.output));
  
        // create writable stream
        output = fs.createWriteStream(options.output);
        output.write('[');
  
        output.on('close', function(){
          stream.emit('complete');
        });
  
        output.on('finish', function() {
          if (options.complete && typeof options.complete === 'function') {
            options.complete(components);
          }
        });
      }
  
      // get all files
      var file;
  
      // collect docs for all files
      for(file in register){
        var docs = parser.getComponents(register[file], file, options);
  
        docs.forEach(function(docItem) {
          // omit first comma
          if(counter !== 0 && options.output){
            output.write(',');
          }
          // add object to stream
          stream.push(docItem);
          if(options.output){
            // send to output
            output.write(JSON.stringify(docItem));
          }
          components.push(docItem);
          // up counter
          ++counter;
        });
      }
  
      // end json array stream
      if(options.output){
        output.write(']');
        output.end();
      } else {
        if (options.complete && typeof options.complete === 'function') {        
          options.complete(components);
        }
      }
  
      // end stream
      stream.push(null);
    }
docs: Init