Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
feature request: prevent Spotlight from indexing node_modules folders #15346
What's the feature?
On macOS NPM could optionally add a
What problem is the feature intended to solve?
While indexing those folders with so many files Spotlight consumes valuable CPU resources. A simple way of preventing this in an automated way is by automatically adding a
It's common practice that most users put the
Is the absence of this feature blocking you or your team? If so, how?
In some systems with large projects Spotlight indexing of these folders can clog the CPU affecting the performance of the machine.
Is this feature similar to an existing feature in another tool?
Not that I know of.
Is this a feature you're prepared to implement, with support from the npm CLI team?
There is an answer on apple.stackexchange.com suggesting what @PierBover asks for works
What I tried:
What's bugging me even more is that is does not index markdown files, at least not their content.
We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.
If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.
For more information about our new issue aging policies and why we've instituted them please see our blog post.
Chrome (and Opera) use the same mechanism for the user profile directory to exclude it from spotlight index.
this .metadata_never_index trick does not seem to work at all. I made a script to insert a blank ".metadata_never_index" file in a bunch of folders (node_modules, bower_components, vendor) and verified that the files were created properly. Than I re-indexed with Spotlight and it still took forever.. create a humongous spotlight index (12gb) and basically did not respect these files at all
I just added it to my folder of repos, rebuilt Spotlight index with the instructions from Apple, and all my repos are gone from my Spotlight searches.
For some reason the usual
Edit: I reversed the procedure (deleted
I'm on High Sierra btw.
Would a PR with this feature be accepted? Can someone point me out where I should start looking to implement this?