# gulp-delete-file

> gulp plugin to delete matched file based on RegExp Obj

Latest version **1.0.2** (published 2015-09-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-delete-file
pnpm add gulp-delete-file
yarn add gulp-delete-file
bun add gulp-delete-file
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-09-28 |
| First published | 2015-09-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | maquan |
| Maintainers | real0n |
| Keywords | gulp, delete, file, RegExp, plugin, matched |

## Links

- npm: https://www.npmjs.com/package/gulp-delete-file
- Repository: https://github.com/Real0n/gulp-delete-file
- Homepage: https://github.com/Real0n/gulp-delete-file#readme
- Issues: https://github.com/Real0n/gulp-delete-file/issues
- npm.io page: https://npm.io/package/gulp-delete-file

## Dependencies (3)

- [fs](https://npm.io/package/fs.md) 0.0.2
- [path](https://npm.io/package/path.md) ^0.12.7
- [stream](https://npm.io/package/stream.md) 0.0.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-09-28
- 1.0.1 — 2015-09-28
- 1.0.0 — 2015-09-28

## README

# gulp-delete-file

### Usage
Initially, install `gulp-delete-file` as a development dependency:


```
npm install --save gulp-delete-file
```
Then, create task using `gulp-delete-file`, which might look similar as below:

```
'use strict';
var gulp = require('gulp'),
	deletefile = require('gulp-delete-file');
gulp.task('deletefile', function () {
	var regexp = /\w*(\-\w{8}\.js){1}$|\w*(\-\w{8}\.css){1}$/;
	gulp.src(['./build/public/train/**/*.js',
		'./build/public/train/**/*.css',
		'./build/public/train/**/*.scss',
		'./build/public/train/**/*.less'
	]).pipe(deletefile({
		reg: regexp,
		deleteMatch: false
	}))
});

```

Finally, fire gulp task:

```
gulp deletefile

```
### API
`reg`：is a RegExp Object

`deleteMatch`:if the value is 'true',then the command will delete all the files which match the reg-rule. if it is 'false',then delete all the files which doesn't match the reg-rule.

### before Usage

```
├── _common
│   ├── bridge
│   ├── hybrid
│   ├── icons
│   ├── msg-f90a9a3d.js
│   ├── msg.js
│   ├── train-487d2c1f.css
│   ├── train-count-ad175de1.js
│   ├── train-count.js
│   ├── train.css
│   ├── train.scss
│   ├── utils-e3a5c9fc.js
│   ├── utils.js
│   └── vendors
	
```

### after usage

```
├── _common
│   ├── bridge
│   ├── hybrid
│   ├── icons
│   ├── msg-f90a9a3d.js
│   ├── train-487d2c1f.css
│   ├── train-count-ad175de1.js
│   ├── utils-e3a5c9fc.js
│   └── vendors
```

---
_Source: https://npm.io/package/gulp-delete-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
