Removing node_modules
files from Alfred's results
Node projects contain a lot of search-irrelevant node_modules
files, which can saturate the macOS metadata index used by Alfred.
Unfortunately, the macOS metadata search API only allows Alfred to include search folders, not exclude them. But there are a few methods you can use to stop seeing those files. You can:
- Manually copy the
node_modules
folders to Spotlight Privacy to exclude them specifically. - Add the whole folder containing your node projects in Spotlight Privacy if you don't need to search them.
- Remove the whole node projects folder from Alfred's search scope.
- Create a File Filter workflow search that doesn't include those folders.
- Add an
alfred:ignore
tag to every file in thenode_modules
folder. The Ignore in Alfred workflow makes the process fast.