Save disk space with Yarn
Yarn is a fast, reliable and secure replacement for npm. Those are all important attributes in my book for a tool I use daily for development, but that's not all Yarn offers.
The node_modules
directory is often a resource consuming hog both in space and number of files. It is full of junk such as test files, build scripts and example directories.
To clean some of those files Yarn offers the clean
command. To run it:
Once run, the command will create a .yarnclean
file with patterns of type of files to be deleted. By default yarn clean
will delete the following:
With this file in your project root directory Yarn will ensure to run a cleaning task after every install and report how much space it saved you.
Tweet