πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

gulp-delete-file

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-delete-file

gulp plugin to delete matched file based on RegExp Obj

1.0.2
latest
Source
npm
Version published
Weekly downloads
595
25.26%
Maintainers
1
Weekly downloads
Β 
Created
Source

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

Keywords

gulp

FAQs

Package last updated on 28 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts