remove-git-ignored
Small library that will find all .gitignore
files from a rootPath
folder and will delete all the ignored files.
Why?
I had a lot of old projects that I didn't worked for a while and I was running out of free space on my disk. I ran a command that would delete all the node_modules
folders in a given rootPath and I "instantly" gained 20GB of free disk.
After that I thought I should have a better way to deal with this and started creating a electron application to manage my workspace, and created a few of core modules to support it, such as:
How it works?
This module uses query-paths to recursively find all the folders with a .gitignore. Then it reads all these files and deletes all files that match what you have defined in it.
Demo
Usage
As cli
> npm i -g remove-git-ignored # Go to the desired root folder> remove-git-ignored
As a node module
const removeGitIgnored = ;const remove = ; remove; remove; remove; remove;