Skip to content

jhermsmeier/gulp-rm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-rm

npm npm npm downloads build status

Install with npm

$ npm install --save-dev gulp-rm

Usage

Passing { read: false } to gulp.src() prevents gulp from reading in the contents of files and thus speeds up the whole process.

NOTE: Deleting directories with dotfiles (i.e. .DS_Store) in them will fail, unless a glob pattern matching them (i.e. app/tmp/**/.*) is also supplied to gulp.src(), as they're considered hidden files and ignored by default by gulp.src().

var gulp = require( 'gulp' )
var rm = require( 'gulp-rm' )

gulp.task( 'clean:tmp', function() {
  return gulp.src( 'app/tmp/**/*', { read: false })
    .pipe( rm() )
})

To force sync fs operations, pass async: false to rm():

gulp.task( 'clean:tmp', function() {
  return gulp.src( 'app/tmp/**/*', { read: false })
    .pipe( rm({ async: false }) )
})

About

Removes files and directories

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published