gulp-clean-old
v0.2.5
Published
A gulp plugin for removing files and folders.
Downloads
20
Readme
gulp-clean-old
Removes files and folders.
Information
Install
Install with npm.
npm install --save-dev gulp-clean-old
Example
var gulp = require('gulp');
var clean = require('gulp-clean-old');
gulp.task('default', function() {
gulp.src('app/tmp', {read: false})
.pipe(clean());
});
Option read false prevents gulp to read the contents of the file and makes this task a lot faster.
After using gulp-clean-old the stream still contains the app/tmp and it can be used i.e. for moving the content to different location.
var gulp = require('gulp');
var clean = require('gulp-clean-old');
gulp.task('default', function() {
gulp.src('app/tmp/index.js', {read: false})
.pipe(clean({force: true}));
.pipe(gulp.dest('dist'));
});
For safety files and folders outside the current working directory can be removed only with option force set to true.
License
MIT @ Peter Vilja