https://github.com/boneskull/nvmermind
trash old versions of node.js installed by nvm
https://github.com/boneskull/nvmermind
Last synced: 5 months ago
JSON representation
trash old versions of node.js installed by nvm
- Host: GitHub
- URL: https://github.com/boneskull/nvmermind
- Owner: boneskull
- License: apache-2.0
- Created: 2021-06-07T17:59:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T01:16:50.000Z (about 1 year ago)
- Last Synced: 2025-01-06T02:27:23.935Z (about 1 year ago)
- Language: JavaScript
- Size: 955 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 😒 nvmermind
> Uninstall old versions of Node.js (as installed by [nvm](https://github.com/nvm-sh/nvm)) while keeping the latest of each major version.
If you have a stinking bonepile of old Node.js versions in your `~/.nvm` folder, this script _takes out the trash._
## Install
You _could_ install this, but maybe better to...
## Usage
Run:
```bash
npx nvmermind
```
`nvmermind` will keep the **latest installed version of _each_ major** it finds.
> Example: if you have `v14.16.1` and `v14.17.0` installed, it will remove `v14.16.1` and keep `v14.17.0`.
`nvmermind` will show you:
- what would be removed
- what will be kept
- how much disk space you'll recover
`nvmermind` will confirm with you (a human) before blasting anything away.
### API
There's an "API", sure. You can `require('nvmermind')`, but I don't feel like documenting it. ~~Maybe next week? There are some docstrings, which is better than nothing.~~
**New in v1.0.0:** There are types now; look at those if you want. I'm still not gonna document it.
### Usage Notes
- Removal uses `nvm uninstall`, which does its thing safely and methodically (_read_: slowly).
- `nvmermind` accepts no options, arguments, flags, or anything else. There is no man page and no `--help`.
- This should work on Windows [insofar as `nvm` works on Windows](https://github.com/nvm-sh/nvm#important-notes).
## Acknowledgments
- I stole some code from Wes Todd's [nvmjs](https://github.com/wesleytodd/nvmjs). I should probably send a PR.
## License
Copyright © 2021 Christopher "[boneskull](https://github.com/boneskull)" Hiller. Licensed Apache-2.0