Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-gray-matter

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-gray-matter

Extract gray-matter header from files.

  • 1.1.0
  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-15%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-gray-matter

A simple gulp plugin for gray-matter.

Build Status NPM version

Streaming is not supported yet. (until gray-matter supports it)

Usage

/**
 * @param {function(this: gray-matter, object): string} opt_handler
 * @param {object} opt_options options for gray-matter
 * @param {string} opt_name propery name for adding frontmatter object to file
 */
var matter = require('gulp-gray-matter');

var noop = function (data) {
    return data.original;
};

/**
 * @param this gray-matter
 * @param {object} data object return from `gray-matter(content)`
 * @return {string}
 */
var handler = function (data) {
    var matter = this;  // not gulp plugin
    return data.content;
};

...
    gulp.src('*.md')
        .pipe(matter(handler, {delims: ['@@@', '@@@']}))
        .pipe(gulp.dest('build'));
...

...
    gulp.src('*.md')
        .pipe(matter(handler, null, 'context'))
        .pipe(custom())  // file.content = Handlerbars.compile(file.content)(file.context)
        .pipe(gulp.dest('build'));
...

License

Copyright © 2014 Jak Wings. Released under the MIT license

Keywords

FAQs

Package last updated on 30 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc