file

  • function
 

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

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

Processes a file's source and calls documentjs.process.codeAndComment accordingly. If the file ends with .js, each comment will be processed individually. Otherwise, it treats the entire source as one big comment.

Parameters

  1. source {String}

    A files source

  2. docMap {docMap}

    A map of the name of each DocObject to the DocObject

  3. filename {String}Optional

    The filename. If a filename is not provided, the entire file is treated as one big comment block. If a filename is provided and is not a .md or .markdown file, it is assumed to be a source file.

  4. options {Object}Optional

    An options object. Currently only the tags option is used.

Use

var docMap = {}; 
documentjs.process.file("import $ from 'jquery' ... ",
     docMap,
     "myproject.js");