clear-path
![npm version](https://badge.fury.io/js/clear-path.svg)
A node library for deleting a path if exists using del.
Instalation
npm i clear-path --save-dev
How
# package.json
{
"scripts": {
"clean": "clear-path"
},
"clearpath": "dist"
}
The clearpath
value can a string, or an array of strings of glob patterns.
Configuration
You must add a configuration either within package.json
, or creating a .clearpathrc
Using package.json
{
"clearpath": [
"dist/*.png",
"dist/*.jpg"
],
}
Using .clearpathrc
dist/*.png
dist/*.jpg
Running this will create a .webp copy on the same path as any .png or .jpg file (node_modules is excluded by default).
How (in JS)
const clearPath = require( "clear-path" );
clearPath("dist");