GithubHelp home page GithubHelp logo

ptzagk / fast-nvm-fish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brigand/fast-nvm-fish

0.0 0.0 0.0 23 KB

a wrapper around node version manager for fish shell with good performance

License: Other

Shell 100.00%

fast-nvm-fish's Introduction

What is nvm?

nvm is a tool for managing multiple versions of node and npm.

What is fast-nvm-fish?

It's a utility that manipulates your PATH to include the desired version of node. Other solutions require parsing env's output and do other slow things. Before this, there was an extra second or two added to my shell startup time. With about 10 versions of node installed this script takes 50ms to run.

Alternatives

You can get even better performance, with a solution that works in fish/bash/zsh by using fnm.

Usage

nvm install 5
nvm use 5 # or e.g. 5.8 or 5.8.1

Install:

Requirements: you must have Fish 2.6.0 or newer.

First install nvm if you haven't already. You can check the nvm readme for a more up to data install command.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Then install fast-nvm-fish:

curl -sSL https://raw.githubusercontent.com/brigand/fast-nvm-fish/master/nvm.fish > ~/.config/fish/functions/nvm.fish

Or using fisher:

fisher add brigand/fast-nvm-fish

The fish_user_paths universal variable must exist before running nvm commands. Run this once in your fish shell:

set -U fish_user_paths

To make it work on new shells you'll need to set a version in config.fish.

echo 'nvm use 7.2.1' >> ~/.config/fish/config.fish

If you have nvm installed anywhere other than ~/.nvm, set a global variable in your config.fish file before first invoking nvm use.

set -gx NVM_DIR ~/custom_path/nvm
nvm use 7.2.1

fast-nvm-fish's People

Contributors

brigand avatar blob42 avatar rmccue avatar bradleyflood avatar nthapaliya avatar proloser avatar pgilad avatar rasmuswl avatar hilzu avatar sebdah avatar the-alchemist avatar tomsaleeba avatar

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.