Tired of wasting gigabytes of Time Machine storage to node_modules folders?

Time Machine supports setting a sticky extended attribute on folders to exclude them from backups.

It works great, and I believe NPM should support it.

I opened an NPM RFC and would love your comments on it: https://github.com/npm/rfcs/pull/857/changes

In the mean time, you can easily set the bit w/ a command like:

xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd /path/to/node_modules/

Let’s do this!

@meego Does Time Machine exclude .git directories? If not, how do I tell it to ignore them?

@wigging No, Time Machine excludes very few directories by default.

You can use the xattr command mentioned earlier, or tmutil addexclusion (its man page is worth a read). For something more definitive that handles newly created .git folders, maybe a git alias in your shell on git clone/checkout?