What Big Backup does not want you to know
du -sh /Users/nmcg/gh/app/node_modules/
485M /Users/nmcg/gh/app/node_modules/Yes, that’s right 485 MB in most of your javascript projects, pointlessly being backed up while Big Tech laughs at you.
Well no more
Rise up and reclaim space on your hard drive and your dignity
from pathlib import Path
import shutil
def readDir(root_dir_path):
d = list(filter(lambda x: x.is_dir(), Path(root_dir_path).iterdir()))
for i in d:
n = i.name
if n == "node_modules":
print(f"node_modules dir found : {i}")
shutil.rmtree(i)
else:
readDir(Path(i))
fp = "/Users/nmcg/gh"
readDir(fp)
Thanks for reading
Please get in touch by email or by twitter if you have any questions or follow ups