{"id":16585818,"url":"https://github.com/numtostr/snm","last_synced_at":"2025-04-09T12:06:59.955Z","repository":{"id":36980809,"uuid":"323911440","full_name":"numToStr/snm","owner":"numToStr","description":"🤏 Smol and simple node version manager written in rust 🦀","archived":false,"fork":false,"pushed_at":"2023-01-16T03:02:44.000Z","size":315,"stargazers_count":109,"open_issues_count":14,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T10:13:47.724Z","etag":null,"topics":["cargo","cli","javascript","node","nodejs","npm","nvm","package","rust","semver","shell","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numToStr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-23T13:36:56.000Z","updated_at":"2024-11-30T05:44:11.000Z","dependencies_parsed_at":"2023-01-17T11:01:55.908Z","dependency_job_id":null,"html_url":"https://github.com/numToStr/snm","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fsnm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fsnm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fsnm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fsnm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numToStr","download_url":"https://codeload.github.com/numToStr/snm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cli","javascript","node","nodejs","npm","nvm","package","rust","semver","shell","version-manager"],"created_at":"2024-10-11T22:49:40.701Z","updated_at":"2025-04-09T12:06:59.936Z","avatar_url":"https://github.com/numToStr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003ccode\u003e🤏 Smol Node Manager\u003c/code\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"build\" href=\"https://github.com/numToStr/snm/actions/workflows/build.yml\"\u003e\n    \u003cimg alt=\"build\" src=\"https://github.com/numToStr/snm/actions/workflows/build.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"crates.io\" href=\"https://crates.io/crates/snm\"\u003e\n    \u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/snm.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"arch-aur\" href=\"https://aur.archlinux.org/packages/snm/\"\u003e\n    \u003cimg alt=\"arch-aur\" src=\"https://img.shields.io/aur/version/snm\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n![snm](https://user-images.githubusercontent.com/24727447/128605309-a0ba7189-4f44-4d11-9671-c14c7c06aaed.gif \"snm in action\")\n\n\u003cp align=\"center\"\u003e\u003csup\u003eTerminal: kitty | Prompt: starship\u003c/sup\u003e\u003c/p\u003e\n\n## ✨ Features\n\n-   It's fast as it is written in Rust.\n-   Cross Platfrom (Linux/macOS/Windows)\n-   Supports `.nvmrc`, `.node-version` and `package.json`\n-   Supports multiple shells\n-   Tons of commands and options\n\n## 🚀 Installation\n\n#### From package managers\n\n-   Using `cargo` (Linux/macOS/Windows)\n\n```sh\ncargo install snm\n```\n\n\u003c!-- -   **Using `brew` (MacOs)** --\u003e\n\u003c!--  --\u003e\n\u003c!-- ```sh --\u003e\n\u003c!-- brew install fnm --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- -   **Using `scoop` (Windows)** --\u003e\n\u003c!--  --\u003e\n\u003c!-- ```sh --\u003e\n\u003c!-- scoop install fnm --\u003e\n\u003c!-- ``` --\u003e\n\n-   Using `yay` or `pamac` (Arch Linux)\n\n\u003e Why snm is available for Arch? Because I love Arch Linux\n\n```sh\n# Using `yay`\nyay -S snm\n\n# Using `pamac`\npamac build snm\n```\n\n#### From binaries\n\nCheck out the [Release page](https://github.com/numToStr/snm/releases) for prebuild binaries for `snm`, available for different operating systems.\n\n#### From script (Linux/macOS/Windows)\n\n```sh\ncurl -fsSL https://git.io/JLFnA | bash\n```\n\nAvailable Params\n\n-   `--install-dir` : Set a custom directory for binary installation. Defaults to `$HOME/.snm`\n-   `--skip-shell` : Skip appending shell specific loader to the `$SHELL` config file.\n\n---\n\n\u003e NOTE: `snm` uses symlinks underneath to manage aliases. So, If you are using **Windows** make sure you have enabled **Developer Mode** or your user has permission to create symlinks. You can read more [here](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/)\n\n---\n\n## 🔧 Setup\n\n-   **Bash**\n\nAdd the following line to your `~/.bashrc`\n\n```bash\neval \"$(snm env bash)\"\n```\n\n-   **Zsh**\n\nAdd the following line to your `~/.zshrc`\n\n```zsh\neval \"$(snm env zsh)\"\n```\n\n-   **Fish**\n\nAdd the following line to your `~/.config/fish/config.fish`\n\n```fish\nsnm env fish | source\n```\n\n-   **PowerShell**\n\nAdd the following line to your `~\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1`\n\n```bash\nsnm env pwsh | Out-String | Invoke-Expression\n```\n\nYou can find more about the powershell profile [here](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles)\n\n## 🤞 Usage\n\n#### Global Options/Flags\n\n| Options              | Env Variable           | Description                                         |\n| -------------------- | ---------------------- | --------------------------------------------------- |\n| `--snm-dir`          | `SNM_DIR`              | Directory where the all files and aliases are saved |\n| `--node-dist-mirror` | `SNM_NODE_DIST_MIRROR` | Nodejs download mirror                              |\n\nExample:\n\n```sh\nsnm [--snm-dir=\"~/.something/else\"] [--node-dist-mirror=\"https://myrelease.com\"]\n```\n\n| Flags       | Description               |\n| ----------- | ------------------------- |\n| `--no-use`  | Only download the release |\n| `--version` | Prints the version        |\n| `--help`    | Prints the help doc       |\n\n#### Commands\n\n-   `snm install \u003cversion|alias\u003e` : Install Nodejs with the provided version or lts codename\n\n```sh\n# Following command will downloads and installs the most recent 14.x.x release\nsnm install 14\n\n# Following command will download the most recent lts/fermium release\nsnm install lts/fermium\n# or snm install lts-fermium\n# or snm i lts-fermium\n```\n\n-   `snm uninstall [version|alias]` : Removes the installed Nodejs\n\n\u003e If given an alias like `ten` or `lts-fermium` then it will remove the version which the alias is pointing at and all the aliases which are pointing to the same version. Also, uninstalling a version will throw an error, if multiple installation is found in the same semver range or if the provided version/alias is active, add `--force` flag to override this behavior.\n\n```sh\n# Following command will remove 14.x.x installation\nsnm uninstall 14\n\n# Following command will remove the lts/fermium release\nsnm uninstall lts/fermium\n# or snm uninstall lts-fermium\n# or snm rm lts-fermium\n\n# Add --force flag to forcefully remove the active version\nsnm uninstall --force 16\n```\n\n-   `snm use [version]` : Change Nodejs version, Supports `.nvmrc` and `.node-version`\n\n```sh\n# Following command will use a downloaded version matching 10.x.x\nsnm use 10\n\n# Searches for `.nvmrc` or `.node-version`, if \u003cversion\u003e is not provided\nsnm use\n```\n\n-   `snm lts` : Installs the recent **lts** release\n\n-   `snm latest` : Installs the recent **current** release\n\n-   `snm ls` : List all the local downloaded versions with their aliases\n\n-   `snm ls-remote [version]` : List remote Node.js versions\n\n```sh\n# Following command list 20 results with version matching 14.x.x\nsnm ls-remote 14\n\n# This will show all the results\nsnm ls-remote 14 --all\n\n# Following command will show 25 results\nsnm ls-remote 14 --count 25\n```\n\n-   `snm alias \u003cversion\u003e \u003cname\u003e` : Alias a version to a common name\n\n```sh\n# Following command will alias the version 10 to ten\n# 10 can refer to any semver release ie 10.15.0\nsnm alias 10 ten\n```\n\n-   `snm unalias [name]` : Removes aliases\n\n```sh\n# Following command will removes alias `ten`\nsnm unalias ten\n\n# Removes all the aliases\nsnm unalias --all\n```\n\n-   `snm exec \u003cversion\u003e` : Executes a command within snm context with the modified PATH\n\n```sh\n# Following command will output the Nodejs version\nsnm exec 10 -- node -v\n\n# Following command will run yarn with Nodejs v10.x.x\nsnm exec 10 -- yarn start\n```\n\n-   `snm purge` : Remove all the installed versions and aliases. Except the active version.\n\n```\n# Doesn't remove the active version\nsnm purge\n\n# Will remove everything including the active version\nsnm purge --all\n```\n\n-   `snm which \u003cversion\u003e` : Prints path for the downloaded Nodejs version\n\n-   `snm help \u003csubcommand\u003e` or `snm \u003csubcommand\u003e --help` : Help doc for the subcommand\n\n\u003e NOTE: This is a small part of help doc. Please make sure to read the inbuilt help\n\n#### Completions\n\n`snm` binary has inbuilt completions supports. Please follow the instruction to generate completions according to your shell.\n\n-   For Zsh\n\n```sh\nsnm completions zsh\n```\n\n-   For Bash\n\n```sh\nsnm completions bash\n```\n\n-   For Fish\n\n```sh\nsnm completions fish\n```\n\n-   For PowerShell\n\n```sh\nsnm completions pwsh\n```\n\nAfter generating the completions, please follow your shell instructions on how to load and use them.\n\n## 🤝 Contributing\n\nPRs are always welcome. You can help me by adding more tests :).\n\nFirst, You need to install rust toolchain via [rustup](https://rustup.rs/).\n\n\u003e Minimum Supported Rust Version (MSRV): 1.54.0\n\n-   **Setup**\n\n```sh\ngit clone https://github.com/numtostr/snm\n\ncd ./snm\n```\n\n-   **Build**\n\n```sh\n# For debug build\ncargo build\n\n\n# For release build\ncargo build --release\n```\n\n-   **Running**\n\n```sh\n# Same as running `snm --help`\ncargo run -- --help\n\n# Same as running `snm lsr 14`\ncargo run -- lsr 14\n```\n\n## 💐 Credits\n\nThis project would not be possible without these awesome projects.\n\n-   [n](https://github.com/tj/n) for cli design\n-   [fnm](https://github.com/Schniz/fnm) for giving me a base project and some code :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtostr%2Fsnm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtostr%2Fsnm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtostr%2Fsnm/lists"}