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.

  • 2.2.2
  • 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

maintainer change. original author: @jakwings

Usage

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

var noop = function (data) {
    return data.orig;  // Since gray-matter v0.5.0, "original" property is renamed "orig"
};

/**
 * @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.contents = Handlerbars.compile(file.contents)(file.context)
        .pipe(gulp.dest('build'));
...

License

Copyright © 2014 Jak Wings. Released under the MIT license

Keywords

FAQs

Package last updated on 03 Feb 2016

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