https://github.com/blakek/ignore-node_modules
🙈 Hide node_modules from macOS Spotlight search
https://github.com/blakek/ignore-node_modules
macos macos-spotlight-search node-modules spotlight
Last synced: 5 months ago
JSON representation
🙈 Hide node_modules from macOS Spotlight search
- Host: GitHub
- URL: https://github.com/blakek/ignore-node_modules
- Owner: blakek
- License: mit
- Created: 2017-01-22T04:06:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T14:49:31.000Z (almost 6 years ago)
- Last Synced: 2025-02-22T00:27:42.331Z (about 1 year ago)
- Topics: macos, macos-spotlight-search, node-modules, spotlight
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ignore-node_modules
> Ignores node_modules directories from macOS Spotlight search
I got tired of Spotlight draining battery and CPU. It seems `node_modules` were
partly to blame.
This script signals Spotlight to not index `node_modules` directories.
It works by adding an empty file named `.metadata_never_index` in the top-most
`node_modules` directory found while searching.
## Usage
Stop indexing all `node_modules` directories in your current directory
(recursively):
```bash
./ignore-node_modules
```
Stop indexing all `node_modules` directories found within another directory
(recursively):
```bash
./ignore-node_modules /path/to/folder
```
## Install
You can install using [Homebrew](https://brew.sh/) or manually build from
source:
### Install with Homebrew
Running this in your terminal adds [my
tap](https://github.com/blakek/homebrew-blakek) and installs the package:
```bash
brew tap blakek/blakek && brew install blakek/blakek/ignore-node_modules
```
### Build from Source
1. Either [clone this
repo](https://help.github.com/articles/cloning-a-repository/) or [download
the zip
file](https://github.com/blakek/ignore-node_modules/archive/master.zip)
2. Add `ignore-node_modules` to your \$PATH (e.g. `/usr/local/bin`)
3. Make sure file permissions allow execution (e.g. `chmod +x ignore-node_modules`). This shouldn't be necessary when cloning, but is
likely when downloading from a browser.
## License
MIT