Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhermsmeier/gulp-rm
Removes files and directories
https://github.com/jhermsmeier/gulp-rm
gulp gulp-plugin
Last synced: 25 days ago
JSON representation
Removes files and directories
- Host: GitHub
- URL: https://github.com/jhermsmeier/gulp-rm
- Owner: jhermsmeier
- License: mit
- Created: 2014-03-11T22:37:33.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T17:51:11.000Z (over 5 years ago)
- Last Synced: 2024-12-15T17:45:16.905Z (about 2 months ago)
- Topics: gulp, gulp-plugin
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gulp-rm
[![npm](http://img.shields.io/npm/v/gulp-rm.svg?style=flat-square)](https://npmjs.com/gulp-rm)
[![npm](http://img.shields.io/npm/l/gulp-rm.svg?style=flat-square)](https://npmjs.com/gulp-rm)
[![npm downloads](http://img.shields.io/npm/dm/gulp-rm.svg?style=flat-square)](https://npmjs.com/gulp-rm)
[![build status](http://img.shields.io/travis/jhermsmeier/gulp-rm.svg?style=flat-square)](https://travis-ci.org/jhermsmeier/gulp-rm)## Install with [npm](https://npmjs.org)
```sh
$ 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()`.```javascript
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()`:
```javascript
gulp.task( 'clean:tmp', function() {
return gulp.src( 'app/tmp/**/*', { read: false })
.pipe( rm({ async: false }) )
})
```