Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
gulp-drafts
Advanced tools
Readme
Gulp plugin for removing files flagged as drafts. Can also be used as an assemble or verb plugin.
The filtering part of the plugin was inspired by gulp-filter.
npm i gulp-drafts --save
All of the following examples should work in any combination with one another.
var gulp = require('gulp');
var drafts = require('gulp-drafts');
gulp.task('blog', function () {
gulp.src('posts/**/*.md')
// remove files from the pipeline if they match the given
// filepath or glob patterns:
.pipe(drafts('**/drafts/*.md'))
.pipe(gulp.dest('dist'));
});
draft
propertyThe plugin automatically filters out files with the draft
or data.draft
property set to true
. Files won't have these properties unless you're setting them on the file object earlier in the pipeline. (Or, if you're using this plugin with [assemble] or [verb] you can define the draft
property in front-matter.)
var gulp = require('gulp');
var drafts = require('gulp-drafts');
gulp.task('blog', function () {
gulp.src('posts/**/*.md')
// files with {draft: true} or {data: {draft: true}}
// will be removed
.pipe(drafts())
.pipe(gulp.dest('dist'));
});
var gulp = require('gulp');
var drafts = require('gulp-drafts');
gulp.task('blog', function () {
gulp.src('posts/**/*.md')
// ignore files with the `{foo: ...}` or `{bar: {baz: ...}}`
// properties
.pipe(drafts({props: ['foo', 'bar.baz']}))
.pipe(gulp.dest('dist'));
});
Everything works the same with [verb] and [assemble].
var verb = require('verb');
var drafts = require('verb-drafts');
verb.task('blog', function () {
verb.src('posts/**/*.md')
// ignore files with the `{foo: ...}` or `{bar: {baz: ...}}`
// properties
.pipe(drafts({props: ['foo', 'bar.baz']}))
.pipe(verb.dest('dist'));
});
Install dev dependencies:
node i -d && mocha
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 22, 2015.
FAQs
Gulp plugin for removing files flagged as drafts. Can also be used as an assemble or verb plugin.
We found that gulp-drafts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).