In addition to concerns about npm, I'm now hesitant to use the GitHub CLI, which stores a highly privileged OAuth token in plain text in the HOME directory. After the attacker accesses it, they can do almost anything on behalf of me, for example, they turned many of my private repos to public.
But protecting specific directories is just whack-a-mole. The real fix is to properly sandbox code - an access whitelist rather than endlessly updating a patchy blacklist
1. Save $14 for retirement and not watch Youtube
2. Save $14 for retirement and watch Youtube with ads
3. Pay $14 a month for Youtube without ads
The only option that's not fair is expecting private companies and creators to give you entertainment and its delivery with nothing in return