Giter Site home page Giter Site logo

nvm-rust's Introduction

nvm(-rust)

Cross platform nvm that doesn't suck™

Installation

Binaries

  1. Download binary for your OS from the Releases
  2. Rename the file to nvm and place it somewhere in your $PATH
  3. Add path/to/nvm-home/shims to your PATH (TODO: document this)
  4. Enjoy?

Cargo

cargo install nvm-rust

Note for Windows

It does not allow creating the symlinks this program uses without either Admin access or Developer Mode.

Either run the program as Administrator or enable Developer Mode

Read more about it here

Feature Comparison

nvm-rust nvm-windows nvm
Platforms Win, Mac, Linux Windows POSIX
Range matching
Version files
Default global packages
Node <4 ✅*
Disabling nvm temporarily
Caching
Aliases

**not supported, might work?

Range Matching

Allowing you to not have to write out the full versions when running a command.

For example:

  • nvm install 12 will install the latest version matching 12, instead of 12.0.0.
  • nvm install "12 <12.18" will install the latest 12.17.x version, instead of just giving you an error.
  • nvm use 12 switch use the newest installed 12.x.x version instead of 12.0.0 (and most likely giving you an error, who has that version installed?).

Version files (package.json#engines, .nvmrc, .tool-versions)

If a version is not specified for the use and install commands nvm-rust will look for and parse any files containing Node version specifications amd use that!

nvm-rust handles files containing ranges, unlike nvm.

e.g.

// package.json
{
  ...
  "engines": {
    "node": "^14.17"
  }
  ...
}

# Installs 14.19.3 as of the time of writing
$ nvm install

The program will use the following file priority:

  1. package.json#engines
  2. .nvmrc
  3. .node-version
  4. .tool-versions from asdf

Default global packages

Development

This project uses Task to execute various development commands.

e.g. to run a command via a debug build, run:

task run -- install 12

To build a release artifact, run:

task build:release

You can find all the commands in the Taskfile.

Publish new version

  1. Up version number in Cargo.toml
  2. Create tag on commit updating the version with said version (vX.X.X)
  3. Push both
  4. Wait for CI to create draft release for tag
  5. Edit draft release notes
  6. Publish

nvm-rust's People

Contributors

beeequeue avatar dependabot[bot] avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nvm-rust's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update Rust crate serde_json to v1.0.120
  • Update Rust crate tar to v0.4.41
  • Update Rust crate assert_fs to v1.1.1
  • Update Rust crate clap to v4.5.9
  • Update Rust crate itertools to 0.13.0
  • Update Rust crate predicates to v3.1.0
  • Update Rust crate ureq to v2.10.0
  • Update Rust crate zip to v2
  • Update actions/upload-artifact action to v4
  • Update softprops/action-gh-release action to v2
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • anyhow 1.0.75
  • clap 4.4.11
  • dialoguer 0.11.0
  • dirs 4.0.0
  • itertools 0.12.0
  • node-semver 2.1.0
  • serde 1.0.193
  • serde_json 1.0.108
  • spectral 0.6.0
  • ureq 2.9.1
  • assert_cmd 2.0.12
  • assert_fs 1.0.13
  • predicates 3.0.4
  • flate2 1.0.28
  • tar 0.4.40
  • zip 0.6.6
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • arduino/setup-task v1
  • Swatinem/rust-cache v2
  • actions/upload-artifact v3
  • actions/checkout v4
  • arduino/setup-task v1
  • Swatinem/rust-cache v2
  • actions/checkout v4
  • arduino/setup-task v1
  • actions-rs/clippy-check v1
.github/workflows/release.yml
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • softprops/action-gh-release v1
  • actions/checkout v4
  • arduino/setup-task v1
  • Swatinem/rust-cache v2
  • softprops/action-gh-release v1

  • Check this box to trigger a request for Renovate to run again on this repository

Version file does not support line ending (.node-version)

Text files often have a line-ending. Depending on the editor, it may be difficult for the user to tell if there is a line-ending or not, or possibly the editor may add one automatically.

It looks like from my limited testing that nvm-rust does not allow the version file to have a trailing line-ending:

% hexdump -C .node-version 
00000000  31 30 2e 31 32 2e 30 0a                           |10.12.0.|
00000008
% nvm install       
Failed to parse .node-version: '10.12.0
'
Error: You did not pass a version and we did not find any version files (package.json#engines, .nvmrc) in the current directory.

(Full disclosure. I am not a user of nvm-rust! I took a look because I am interested in application support for .node-version: https://github.com/shadowspawn/node-version-usage)

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.