Add gulp example.

This commit is contained in:
David Anson 2015-03-13 22:38:44 -07:00
parent 9917d7f2fb
commit f252f4f498
2 changed files with 22 additions and 1 deletions

21
example/gulpfile.js Normal file
View file

@ -0,0 +1,21 @@
"use strict";
var gulp = require("gulp");
var through2 = require("through2");
var markdownlint = require("../lib/markdownlint");
// Simple task wrapper
gulp.task("markdownlint", function task() {
return gulp.src("*.md", { "read": false })
.pipe(through2.obj(function obj(file, enc, next) {
markdownlint(
{ "files": [ file.relative ] },
function callback(err, result) {
var resultString = (result || "").toString();
if (resultString) {
console.log(resultString);
}
next(err, file);
});
}));
});