# Delete all Dependency Folders
Removes folders like `node_modules` & `bower_components`.
Install by placing that in a `.bash_profile` or similar.
This would run it in current directory and recurse on down:
```bash
delete-all-dep-folders
```
This would run it on the folder you point to:
```bash
delete-all-dep-folders path/to/folder/
```
# Delete dep folders: `node_modules`, `bower_components`
# @param $1 [.] Which folder to recursively look in; defaults to cwd (`.`).
delete-all-dep-folders() {
# `-prune` prevents building up lists of `node_modules` inside `node_modules`
find ${1:-.} -type d -name "node_modules" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
find ${1:-.} -type d -name "bower_components" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
# This one is a little spooky as `vendor/` folders aren't exclusive to Composer.
# @todo Test if `composer.json` is next to `vendor/` before deleting.
# find ${1:-.} -type d -name "vendor" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
}