Code Monkey home page Code Monkey logo

fish-nvm's Introduction

fish-nvm (Node.js Version Manager)

Build Status Releases

fish-nvm is a Node.js version manager for the fish shell.

Features

  • Zero configuration, pure-fish, binary management
  • No subshells, no dependencies, no nonsense
  • Tab completions included out of the box

Installation

fisher add jorgebucaran/fish-nvm

Manual Installation

Download nvm.fish to your fish configuration directory to install (or upgrade) nvm manually. If nvm is not immediately available after the download, you can launch a new session, or replace the current session with a new one.

set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config

for i in {conf.d,functions,completions}
  curl https://git.io/$i.nvm.fish --create-dirs -sLo $XDG_CONFIG_HOME/fish/$i/nvm.fish
end

To uninstall nvm from your system run this code.

rm -f $XDG_CONFIG_HOME/fish/{conf.d,functions,completions}/nvm.fish && emit nvm_uninstall

System Requirements

Usage

This will download the latest Node.js release tarball from the official mirror, extract it to $XDG_CONFIG_HOME/nvm and modify your $PATH so it can be used right away. Learn more about the Node.js release schedule here.

nvm use latest

This will download and use the latest LTS (long-term support) Node.js release.

nvm use lts

You can create a .nvmrc file in the root of your project (or any parent directory) and run nvm to use the version contained in it. We'll attempt to find the nearest .nvmrc file, traversing the directory tree from the current working directory upwards.

echo 10 >.nvmrc
nvm

Running nvm in any subdirectory of a directory with an .nvmrc file will read the Node.js version from that file. Similarly, running nvm use <version> will update that .nvmrc file with the specified version.

├── README.md
├── dist
    └── foo.min.js
├── node_modules
├── package.json
└── src
    └── index.js
echo 10 >.nvmrc
cd src
nvm
node -v
10.15.0

List all supported Node.js versions.

nvm ls
...
10.14.2    (lts/dubnium)
10.15.0    (lts/dubnium)
 11.0.0
 11.1.0
 11.2.0
 11.3.0
 11.4.0
 11.5.0
 11.6.0
 11.7.0    (latest/current)

Want to narrow that down a bit? You can use a regular expression to refine the output.

nvm ls '^8.[4-6]'
8.4.0    (lts/carbon)
8.5.0    (lts/carbon)
8.6.0    (lts/carbon)

Are you behind a firewall? Use the $nvm_mirror variable to customize the download mirror.

set -g nvm_mirror http://npm.taobao.org/mirrors/node

License

MIT

fish-nvm's People

Contributors

jorgebucaran avatar wesbaker avatar yohanboniface avatar franciscolourenco avatar fabioantunes avatar ryanq avatar saintwinkle avatar vincentbel avatar ngryman avatar

Watchers

James Cloos 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.