GithubHelp home page GithubHelp logo

waldyrious / fnm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from schniz/fnm

0.0 2.0 0.0 2.46 MB

๐Ÿš€ Fast and simple Node.js version manager, built in native ReasonML

License: GNU General Public License v3.0

Shell 11.90% C++ 8.25% Dockerfile 0.47% JavaScript 3.68% Reason 75.71%

fnm's Introduction

Fast Node Manager (fnm) Amount of downloads Build Status

๐Ÿš€ Fast and simple Node.js version manager, built in native ReasonML

Blazing fast!

Features

โœจ Single file, easy installation, instant startup

๐Ÿš€ Built with speed in mind

๐Ÿค” Works with .nvmrc and .node-version files

Installation

Using Homebrew (OSX)

brew install Schniz/tap/fnm

This is a custom tap I'm maintaining, and will be used until fnm will move to the official one.

Using a script

For bash, zsh and fish shells, there's an automatic installation script:

curl -fsSL https://github.com/Schniz/fnm/raw/master/.ci/install.sh | bash

Upgrade

Upgrading fnm is almost the same as installing it. To prevent duplication in your shell config file add --skip-shell to install command.

Parameters

--install-dir

Set a custom directory for fnm to be installed. The default is $HOME/.fnm.

--skip-shell

Skip appending shell specific loader to shell config file, based on the current user shell, defined in $SHELL. e.g. for Bash, $HOME/.bashrc. $HOME/.zshrc for Zsh. For Fish - $HOME/.config/fish/config.fish

--force-install

MacOS installations using the installation script are deprecated in favor of the Homebrew formula, but this forces the script to install using it anyway.

Example:

curl -fsSL https://github.com/Schniz/fnm/raw/master/.ci/install.sh | bash -s -- --install-dir "./.fnm" --skip-shell

Manually

  • Download the latest release binary for your system

  • Make it available globally on $PATH

  • Add the following line to your .bashrc/.zshrc file:

    eval "`fnm env --multi`"

    If you are using fish shell, add this line to your config.fish file:

    fnm env --multi | source

Usage

You can always use fnm --help to read the docs:

fnm install [VERSION]

Installs [VERSION]. If no version provided, it will install the version specified in the .nvmrc file located in the current working directory.

fnm use [VERSION]

Activates [VERSION] as the current Node version. If no version provided, it will activate the version specified in the .nvmrc or .node-version file located in the current working directory.

fnm ls

Lists the installed Node versions.

fnm ls-remote

Lists the Node versions available to download remotely.

fnm alias [VERSION] [NAME]

Aliases a Node version to a given name.

fnm default [VERSION]

Aliases a Node version as default. Uses fnm alias underneath.

fnm env [--multi] [--shell=fish|bash|zsh] [--node-dist-mirror=URI] [--use-on-cd] [--fnm-dir=DIR] [--log-level=quiet|error|all]

Prints the required shell commands in order to configure your shell, Bash compliant by default.

  • Providing --multi will output the multishell support, allowing a different current Node version per shell
  • Providing --shell=fish will output the Fish-compliant version. Omitting it and fnm will try to infer the current shell based on the process tree
  • Providing --node-dist-mirror="https://npm.taobao.org/dist" will use the Chinese mirror of Node.js
  • Providing --use-on-cd will also output a script that will automatically change the node version if a .nvmrc/.node-version file is found
  • Providing --fnm-dir="/tmp/fnm" will install and use versions in /tmp/fnm directory

Future Plans

  • Feature: fnm use --install
  • Linux: Replace tar with a statically linked library too (for ungzip + untar)
  • Windows Support? @ulrikstrid has worked hard to make it compile on Windows, but it will probably need to have different code paths and logic. We can probably make another program and share feature tests with it, instead of relying on Windows for this very-unixy binary.

Contributing

PRs welcome ๐ŸŽ‰

Developing:

npm install -g esy
git clone https://github.com/Schniz/fnm.git
cd fnm/
esy install
esy bootstrap
esy build

Running Binary:

After building the project, you can run the main binary that is produced.

esy x fnm.exe

Running Tests:

# Runs some smoke-unity test
esy test

# Runs the feature tests
feature_tests/run.sh

fnm's People

Contributors

schniz avatar thomsj avatar tatchi avatar pavelloz avatar elliottsj avatar ulrikstrid avatar adamgs avatar chrisdaley avatar vladimyr avatar dean177 avatar dangdennis avatar hwartig avatar jletey avatar from-nibly avatar maxknee avatar ranyitz avatar ohana54 avatar trevershick avatar kentac55 avatar

Watchers

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