Created
March 5, 2017 19:24
-
-
Save oscarotero/9628cb6971036a85d70b50bc0229ef2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const through = require('through2'); | |
const matter = require('front-matter'); | |
module.exports = function () { | |
return through.obj(function (file, encoding, callback) { | |
callback(null, run(file)); | |
}); | |
} | |
function run (file) { | |
file.data = matter(String(file.contents)); | |
return file; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment