If anyone else wants to know how to delete node_modules folders that haven't been used recently, modify the find command to check the mtime (modified time) of the folder. I use this to only delete node_modules older than 30 days like so;
Delete node_modules older than 30 days;
find .-name"node_modules"-type d -prune-print-mtime +30 | xargs du-chs
The -mtime flag can be configured other ways, e.g. to get all files modified today pass -1 instead.
If anyone else wants to know how to delete node_modules folders that haven't been used recently, modify the find command to check the mtime (modified time) of the folder. I use this to only delete node_modules older than 30 days like so;
Delete node_modules older than 30 days;
The -mtime flag can be configured other ways, e.g. to get all files modified today pass -1 instead.
WOW I love this !!!! This is an amazing addition :)
Adding this to my bash profile immediately - this is basically what I've always needed!
Great find Seb !