Skip to content

Instantly share code, notes, and snippets.

@uxdiva
uxdiva / gulpWriteToJson.js
Last active Jun 5, 2017
gulp function to write jade variables to a json file
View gulpWriteToJson.js
var through = require('through2');
var matter = require('jade-var-matter');
var jsonfile = require('jsonfile')
// Example -- sending jade files to writeToJson function
gulp.task('postsmeta', function() {
return gulp.src( jadesrc +'posts/*')
.pipe(writeToJson(
dest = jadesrc +'pages/data.json' // set file path
))