Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/nicolodiamante/nodo

Tired of dealing with those pesky 'node_modules' cluttering up your project? Get the Zsh plugin that keeps your workspace squeaky clean!
https://github.com/nicolodiamante/nodo

directory-management icloud-document-storage icloud-drive icloud-sync node node-js nodejs nodejs-modules nodemodules nodeproject ohmyzish-plugin ohmyzsh ohmyzsh-customize plugin zsh

Last synced: about 1 month ago
JSON representation

Tired of dealing with those pesky 'node_modules' cluttering up your project? Get the Zsh plugin that keeps your workspace squeaky clean!

Lists

README

        




nodo

Node_modules directory is an essential component of Node.js projects, but it can often become a nuisance when it takes up too much disk or cloud storage space. It is not uncommon for node_modules directories to contain thousands or even millions of files. This can be a problem for inactive projects, as the folder can occupy valuable storage space. One might wonder why they would want to keep such large node_modules folders for inactive projects when package.json can recreate them anytime.

Fortunately, there is a solution to this problem. If you're working on a Mac, [iCloud][apple-icloud] runs in the background and can sync files across devices. However, this can fill up your iCloud storage quickly. To prevent this, you can use the nodo utility. It helps to un-sync the node_modules directory and save space by removing all node_modules directories within the chosen root directory. This is particularly useful for cleaning up a project that has multiple node_modules trees. By using this utility, you can free up valuable storage space and optimise your project.


## Getting Started

Here are the two methods you can choose from:

**Automatic Download via `curl`:** Simply execute the following command in your terminal to quickly download and seamlessly install the utility:

```shell
zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nicolodiamante/nodo/HEAD/bootstrap.zsh)"
```

**Manual Cloning:** For those who prefer a hands-on approach, you can manually clone the repository to your desired location:

```shell
git clone https://github.com/nicolodiamante/nodo.git ~/nodo
```


### Post-Download Steps

**Directory Navigation & Script Execution:** Navigate to the root directory of the repository, and then execute the installation script using the following command:

```shell
source utils/install.zsh
```

**Nodo Configuration**: This script aims to locate the `zshrc` file, then appends the path `nodo/script` to the `fpath` variable.

```shell
fpath=(~/nodo/script $fpath)
autoload -Uz nodo
```


### Install via [Oh My Zsh][ohmyzsh]

If you're using Oh My Zsh, you can install `nodo` as a plugin:

```shell
git clone https://github.com/nicolodiamante/nodo.git $ZSH_CUSTOM/plugins/nodo
```

Then, add `nodo` to your `.zshrc` plugins array:

```shell
plugins=(... nodo)
```

Restart theshell to activate the changes.


## How to use nodo

```shell
nodo [option]
```

Options:

- `--nosync`: Stop the sync of the `node_modules` directory into iCloud.
- `--remove`: Remove the `node_modules` directory within the chosen root directory.

For a comprehensive list of options and functionalities, use: `nodo --help`.


## Notes

When nodo is launched inside a Git repository, it will search for the .gitignore file. If it does not find it, it will create it. If it does find it, nodo will append node_modules to the existing .gitignore file. This ensures that the node_modules directory will be ignored by Git and will not be included in future commits, further optimising the project and saving valuable storage space.


### Resources

- [Node.js][node-modules]

### Contribution

Any suggestions or feedback you may have for improvement are welcome. If you encounter any issues or bugs, please report them to the [issues page][issues].




>



Nicolò Diamante Portfolio




MIT License

[apple-icloud]: https://www.apple.com/icloud/
[ohmyzsh]: https://github.com/robbyrussell/oh-my-zsh/
[node-modules]: https://nodejs.org/api/modules.html
[issues]: https://github.com/nicolodiamante/nodo/issues