sfcode
An Online Competing and Development Environment
|
Delete files and folders using globs
Pretty much rimraf with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above.
🔥 Want to strengthen your core JavaScript skills and master ES6?
I would personally recommend this awesome ES6 course by Wes Bos.
The glob pattern **
matches all children and the parent.
So this won't work:
You have to explicitly ignore the parent directories too:
Suggestions on how to improve this welcome!
Returns a promise for an array of deleted paths.
Returns an array of deleted paths.
Type: string
, array
See supported minimatch patterns.
Type: object
See the node-glob
options.
Type: boolean
Default: false
Allow deleting the current working directory and outside.
Type: boolean
Default: false
See what would be deleted.
See del-cli for a CLI for this module and trash-cli for a safe version that is suitable for running by hand.
MIT © Sindre Sorhus