Giter Site home page Giter Site logo

nvm-switcher's Introduction

↬ Node nvm-switcher

Automatically switch node versions through nvm based on package.json recommended engine version.

How to install

  • First of all, make sure you have NVM installed:
  • Clone this repository into any folder you'd like:
    • git clone https://github.com/Nick-Gabe/nvm-switcher.git
  • Install the code in your shell:
    • Check what is the configuration file of your shell, for example .zshrc, .bashrc, $profile...
    • Add the following line to the end of it: nvm use $(node <directory>/nvm-switcher)
    • Replace <directory> by the directory the repository is in.

After all those steps, once you open a shell, it will automatically execute the nvm-switcher command and find the optimal version for you.

Want to contribute?

  • Fork the repo here
  • Clone it:
git clone https://github.com/<user>/nvm-switcher.git
# replace <user> with your username
  • Do the changes and updates, push them to your repository
  • Create a Pull Request here!

Why make the code in Javascript?

Since we're talking about node versions, you should already have node in your system, therefore using javascript provides a more understandable code and easier API than bash for example.

But this might change at some point, due to javascript not being the most optimal language in terms of speed for this kind of operation which requires running terminal commands.

nvm-switcher's People

Contributors

nick-gabe avatar

Stargazers

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

Watchers

 avatar

Forkers

brunofariasdeo

nvm-switcher's Issues

Split main file into modules

Currently the index.js file holds all the code for the version switching logic. I like the idea of splitting it into multiple files to make it easier to test (#1) and also for better organization and readability, since it is easier to locate yourself and comprehend the code in smaller files.

Create unitary tests

I like using jest for unitary testing. With it we would be able to test the version strings and maybe even internal functions of the main function.

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.