All Projects → numToStr → Snm

numToStr / Snm

Licence: gpl-3.0
🤏 Smol Node Manager written in Rust

Programming Languages

javascript
184084 projects - #8 most used programming language
rust
11053 projects

Projects that are alternatives of or similar to Snm

Vuepack
Publish .vue files in NPM packages
Stars: ✭ 242 (+908.33%)
Mutual labels:  package, npm
Wasm Pack
This tool seeks to be a one-stop shop for building and working with rust- generated WebAssembly that you would like to interop with JavaScript, in the browser or with Node.js. wasm-pack helps you build rust-generated WebAssembly packages that you could publish to the npm registry, or otherwise use alongside any javascript packages in workflows that you already use, such as webpack.
Stars: ✭ 3,848 (+15933.33%)
Mutual labels:  package, npm
nodenv-nvmrc
nodenv plugin that detects the node version based on .nvmrc.
Stars: ✭ 30 (+25%)
Mutual labels:  nvm, version-manager
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (+483.33%)
Mutual labels:  package, npm
Vanilla Framework
From community websites to web applications, this CSS framework will help you achieve a consistent look and feel.
Stars: ✭ 476 (+1883.33%)
Mutual labels:  package, npm
React Native Story
React native instagram story
Stars: ✭ 144 (+500%)
Mutual labels:  package, npm
Yvm
🧶 Manage multiple versions of Yarn
Stars: ✭ 265 (+1004.17%)
Mutual labels:  npm, version-manager
Npmarket
🛒 More efficient search for node packages.
Stars: ✭ 91 (+279.17%)
Mutual labels:  package, npm
Npm Consider
Check package dependencies before installing it
Stars: ✭ 386 (+1508.33%)
Mutual labels:  package, npm
Fish Nvm
nvm wrapper for fish-shell
Stars: ✭ 336 (+1300%)
Mutual labels:  npm, nvm
Tosin
Initialize a npm package with everything included, from CI to documentation website
Stars: ✭ 142 (+491.67%)
Mutual labels:  package, npm
Oji
(◕‿◕) Text Emoticons Maker
Stars: ✭ 668 (+2683.33%)
Mutual labels:  package, npm
Docusign Node Client
The Official DocuSign Node.js Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
Stars: ✭ 108 (+350%)
Mutual labels:  package, npm
Npmvet
A simple CLI tool for vetting npm package versions
Stars: ✭ 193 (+704.17%)
Mutual labels:  package, npm
Npm Try
🚆 Quickly try npm packages without writing boilerplate code.
Stars: ✭ 103 (+329.17%)
Mutual labels:  package, npm
zsh-lazyenv
Environments for lazy load commands and speed up start up time of zsh
Stars: ✭ 16 (-33.33%)
Mutual labels:  nvm, version-manager
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (+225%)
Mutual labels:  package, npm
Enseada
A Cloud native multi-package registry
Stars: ✭ 80 (+233.33%)
Mutual labels:  package, npm
Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (+1270.83%)
Mutual labels:  package, npm
Lass
👧 Lass scaffolds a modern package boilerplate for Node.js
Stars: ✭ 615 (+2462.5%)
Mutual labels:  package, npm

🤏 Smol Node Manager

Features

  • It's fast as it is written in Rust.
  • Cross Platfrom (Linux/macOS/Windows)
  • Supports .nvmrc, .node-version and package.json
  • Supports multiple shells
  • Tons of commands and options

Installation

From script (Linux/macOS/Windows)

curl -fsSL https://git.io/JLFnA | bash

Available Params

  • --install-dir : Set a custom directory for binary installation. Defaults to $HOME/.snm
  • --skip-shell : Skip appending shell specific loader to the $SHELL config file.

From package managers

  • Using cargo (Linux/macOS/Windows)
cargo install snm
  • Using yay or pamac (Arch Linux)

Why snm is available for Arch? Because I love Arch Linux

# Using `yay`
yay -S snm

# Using `pamac`
pamac build snm

From binaries

Check out the Release page for prebuild binaries for snm, available for different operating systems.


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


Shell

  • Bash

Add the following line to your ~/.bashrc

eval "$(snm env bash)"
  • Zsh

Add the following line to your ~/.zshrc

eval "$(snm env zsh)"
  • Fish

Add the following line to your ~/.config/fish/config.fish

snm env fish | source
  • PowerShell

Add the following line to your ~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

snm env pwsh | Out-String | Invoke-Expression

You can find more about the powershell profile here

Usage

Global Options/Flags

Options Env Variable Description
--snm-dir SNM_DIR Directory where the all files and aliases are saved
--node-dist-mirror SNM_NODE_DIST_MIRROR Nodejs download mirror

Example:

snm [--snm-dir="~/.something/else"] [--node-dist-mirror="https://myrelease.com"]
Flags Description
--download-only Only downloads the release
--version Prints the version
--help Prints the help doc

Commands

  • snm install <version|alias> : Install Nodejs with the provided version or lts codename
# Following command will downloads and installs the most recent 14.x.x release
snm install 14

# Following command will download the most recent lts/fermium release
snm install lts/fermium
# or snm install lts-fermium
# or snm i lts-fermium
  • snm uninstall [version|alias] : Removes the installed Nodejs

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

# Following command will remove 14.x.x installation
snm uninstall 14

# Following command will download the most recent lts/fermium release
snm uninstall lts/fermium
# or snm uninstall lts-fermium
# or snm rm lts-fermium
  • snm use [version] : Change Nodejs version, Supports .nvmrc and .node-version
# Following command will use a downloaded version matching 10.x.x
snm use 10

# Searches for `.nvmrc` or `.node-version`, if <version> is not provided
snm use
  • snm lts : Installs the recent lts release

  • snm latest : Installs the recent current release

  • snm ls : List all the local downloaded versions with their aliases

  • snm ls-remote [version] : List remote Node.js versions

# Following command list 20 results with version matching 14.x.x
snm ls-remote 14

# This will show all the results
snm ls-remote 14 --all

# Following command will show 25 results
snm ls-remote 14 --count 25
  • snm alias <version> <name> : Alias a version to a common name
# Following command will alias the version 10 to ten
# 10 can refer to any semver release ie 10.15.0
snm alias 10 ten
  • snm unalias [name] : Removes aliases
# Following command will removes alias `ten`
snm unalias ten

# Removes all the aliases
snm unalias --all
  • snm exec <version> : Executes a command within snm context with the modified PATH
# Following command will output the Nodejs version
snm exec 10 -- node -v

# Following command will run yarn with Nodejs v10.x.x
snm exec 10 -- yarn start
  • snm prune : Remove all downloaded versions except the installed version

  • snm which <version> : Prints path for the downloaded Nodejs version

  • snm help <subcommand> or snm <subcommand> --help : Help doc for the subcommand

NOTE: This is a small part of help doc. Please make sure to read the inbuilt help

Completions

snm binary has inbuilt completions supports. Please follow the instruction to generate completions according to your shell.

  • For Zsh
snm completions zsh
  • For Bash
snm completions bash
  • For Fish
snm completions fish
  • For PowerShell
snm completions pwsh

After generating the completions, please follow your shell instructions on how to load and use them.

Contributing

PRs are always welcome. You can help me by adding more tests 🤞.

First, You need to install rust toolchain via rustup.

  • Setup
git clone https://github.com/numtostr/snm

cd ./snm
  • Build
# For debug build
cargo build


# For release build
cargo build --release
  • Running
# Same as running `snm --help`
cargo run -- --help

# Same as running `snm lsr 14`
cargo run -- lsr 14

Credits

This project would not be possible without these awesome projects.

  • n for cli design
  • fnm for giving me a base project and some code :)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].