How to maintain Node projects with iCloud Drive
iCloud Drive is infinitely helpful for anybody plugged into the Apple eco-system. My primary development machine is the 12" Macbook, which costs about $1100. I love it to death. Seemingly endless battery life, a crisp, snappy keyboard that your fingers can fly across, an incredible retina display, all built on top of a UNIX system; what’s not to love?
When Apple reinvigorated its iCloud Drive platform, it really got me committed. My two development machines, the aforementioned 12" Macbook and a late model 15" Macbook Pro, share a filesystem. Whatever I’m doing on the road with the 12" can be picked up in a heartbeat as soon as I need more power on the less portable 15". It’s a developer’s dream.
The one issue that I initially came up against was what not to store in iCloud Drive. For instance, all of my coding projects are stored in iCloud Drive, which is great; its another layer of protection for every line that I write. But when working with Node.js, both your network and your iCloud Drive space will be quickly filled up with a hundred repetitions of
node_modules . Just like with a
.gitignore , there are many times when you don’t want things to be backed up in the cloud, since they are per-instance and non-essential. When I first configured my laptops with iCloud Drive, I simply deleted all of my
node_modules folders from all my projects; not a permanent solution.
The solution is very simple. Simply add a file named
.nosync to any folder that you don’t want to be synced. That’s it! Adding
.nosync to every
node_modules folder will allow you to back up all of your current projects and files without storing a hundred versions of every module you need.