code

  • function
 

Process a code hint into properties on a docObject.

documentjs.process.code(options, callback)

Using the options.code, and options.tags, processes the code into properties on a docObject. The callback is called with the new docObject.

Parameters

  1. options {processOptions}

    An options object that contains the code to process.

  2. callback {function(newDoc, newScope)}

    A function that is called back with a docObject created from the code and the scope docObject. If no docObject is created, newDoc will be null.

Use

documentjs.process.code(
      {code: "foo: function(){"}, 
   function(newDoc){
     newDoc.type //-> "function"
   }
)