lib/index.js
function frontmatter(opts){
  var options = {}, grayMatterOptions = {};
  Object.keys(opts || {}).forEach(function(key){
    if (key === 'namespace'){
      options[key] = opts[key];
    } else {
      grayMatterOptions[key] = opts[key];
    }
  });

  return each(function(file, filePath){
    extractFrontmatter(file, filePath, options, grayMatterOptions);
  });
}
function frontmatter(opts){
  var options = {}, grayMatterOptions = {};
  Object.keys(opts || {}).forEach(function(key){
    if (key === 'namespace'){
      options[key] = opts[key];
    } else {
      grayMatterOptions[key] = opts[key];
    }
  });

  return each(function(file, filePath){
    extractFrontmatter(file, filePath, options, grayMatterOptions);
  });
}
function frontmatter ( opts ) { var options = { } , grayMatterOptions = { } ; Object . keys ( opts || { } ) . forEach ( function ( key ) { if ( key === 'namespace' ) { options [ key ] = opts [ key ] ; } else { grayMatterOptions [ key ] = opts [ key ] ; } } ) ; return each ( function ( file , filePath ) { extractFrontmatter ( file , filePath , options , grayMatterOptions ) ; } ) ; }
Metalsmith plugin to extract metadata from frontmatter in file contents.

@param {Object} options - `Namespace` is used, the rest is passed on to `gray-matter`
@return {Function}
Metalsmith plugin to extract metadata from frontmatter in file contents .