> For the complete documentation index, see [llms.txt](https://javascriptuse.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascriptuse.gitbook.io/javascript/gulp-cleaning-unwanted-files.md).

# \[GULP] Gulp - Cleaning Unwanted Files

### Installing del Plugins

```
npm install del --save-dev
```

### Declare Dependencies and Create Tasks

```
var del = require('del');
```

```
gulp.task('clean:build', function() {
   return del.sync('build');
});
```

specific file or folder

```
gulp.task('clean:build', function() {
   //return del.sync('build');
   return del([
      'build/temp/',
      // instructs to clean temp folder
      '!build/package.json'
      // negate to instruct not to clean package.json file ]);
});
```
