function extract (opts) {
  opts = opts || {};
  var
    engine = opts.handlebars || require('handlebars'),
    template = opts.template,
    target = opts.target || {};

  engine.registerHelper(opts.blockName || 'content', helper({
    target: target,
  }));

  if (typeof template === 'string') template = engine.compile(template);

  template();

  return target;
}
/**
 * Extracts content from a template.
 *
 * @param object opts Options
 * @param object|undefined opts.handlebars Instance of handlebars to use.
 * @param string|function opts.template Template to extract from. String or
 *   return value of handlebars.compile().
 * @param object|undefined opts.target Object to populate with content.
 * @param string|undefined opts.blockName Name of the handlebars block (helper).
 * @return object Hash of the content.
 */
Extracts content from a template.
@param object opts Options
@param object|undefined opts.handlebars Instance of handlebars to use.
@param string|function opts.template Template to extract from. String or
return value of handlebars.compile().
@param object|undefined opts.target Object to populate with content.
@param string|undefined opts.blockName Name of the handlebars block (helper).
@return object Hash of the content.
Extracts content from a template . @param object opts Options @param object|undefined opts . handlebars Instance of handlebars to use . @param string|function opts . template Template to extract from . String or return value of handlebars . compile () . @param object|undefined opts . target Object to populate with content . @param string|undefined opts . blockName Name of the handlebars block ( helper ) . @return object Hash of the content .
function extract (opts) {
  opts = opts || {};
  var
    engine = opts.handlebars || require('handlebars'),
    template = opts.template,
    target = opts.target || {};
  engine.registerHelper(opts.blockName || 'content', helper({
    target: target,
  }));
  if (typeof template === 'string') template = engine.compile(template);
  template();
  return target;
}
function extract ( opts ) { opts = opts || { } ; var engine = opts . handlebars || require ( 'handlebars' ) , template = opts . template , target = opts . target || { } ; engine . registerHelper ( opts . blockName || 'content' , helper ( { target : target , } ) ) ; if ( typeof template === 'string' ) template = engine . compile ( template ) ; template ( ) ; return target ; }
Extracts content from a template.
Extracts content from a template .