peter-vilja / gulp-clean

A gulp plugin for removing files and folders from given paths.
177 stars 21 forks source link

Advocate use of read: false #2

Closed yocontra closed 10 years ago

yocontra commented 10 years ago
var gulp = require('gulp');
var clean = require('gulp-clean');

gulp.task('default', function() {
    gulp.src(['app/tmp']. {read: false})
        .pipe(clean());
});

This will be a lot faster since there it actually won't hit the file system to read the contents of the file

yocontra commented 10 years ago

Your section

After using gulp-clean the stream still contains the app/tmp and it can be used i.e. for moving the content to different location.

Should not use read: false. read false means file.contents = null, useful only when plugins don't need the contents.

peter-vilja commented 10 years ago

Yes. Thank you. I wrote that before adding {read: false} and didn't notice the issue.

yocontra commented 10 years ago

You misunderstand me. That example won't work with read: false - you need to add a note in the README about when to use it and when not to. In that example you would not want to use it.

peter-vilja commented 10 years ago

Again yes. Only thought about the text and didn't check the example. Thank you.