Full Code of Schniz/fnm for AI

master bfb186034978 cached
152 files
391.3 KB
111.5k tokens
389 symbols
1 requests
Download .txt
Showing preview only (425K chars total). Download the full file or copy to clipboard to get everything.
Repository: Schniz/fnm
Branch: master
Commit: bfb186034978
Files: 152
Total size: 391.3 KB

Directory structure:
gitextract_q8q0nzc1/

├── .changeset/
│   ├── README.md
│   ├── brave-timers-move.md
│   ├── config.json
│   ├── cuddly-cars-ring.md
│   └── fair-carrots-greet.md
├── .ci/
│   ├── get_shell_profile.sh
│   ├── install.sh
│   ├── prepare-static-build.sh
│   ├── prepare-version.js
│   ├── print-command-docs.js
│   ├── record_screen.sh
│   ├── recorded_screen_script.sh
│   ├── test_installation_script.sh
│   └── type-letters.js
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── debug.yml
│       ├── installation_script.yml
│       ├── release-to-cargo.yml
│       ├── release.yml
│       └── rust.yml
├── .gitignore
├── .kodiak.toml
├── .node-version
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── README.md
├── benchmarks/
│   ├── basic/
│   │   ├── fnm
│   │   └── nvm
│   ├── run
│   └── run.mjs
├── build.rs
├── docs/
│   ├── commands.md
│   ├── configuration.md
│   └── nightly.md
├── e2e/
│   ├── __snapshots__/
│   │   ├── aliases.test.ts.snap
│   │   ├── basic.test.ts.snap
│   │   ├── corepack.test.ts.snap
│   │   ├── current.test.ts.snap
│   │   ├── env.test.ts.snap
│   │   ├── exec.test.ts.snap
│   │   ├── existing-installation.test.ts.snap
│   │   ├── latest-lts.test.ts.snap
│   │   ├── latest.test.ts.snap
│   │   ├── log-level.test.ts.snap
│   │   ├── multishell.test.ts.snap
│   │   ├── nvmrc-lts.test.ts.snap
│   │   ├── old-versions.test.ts.snap
│   │   ├── uninstall.test.ts.snap
│   │   └── use-on-cd.test.ts.snap
│   ├── aliases.test.ts
│   ├── basic.test.ts
│   ├── corepack.test.ts
│   ├── current.test.ts
│   ├── describe.ts
│   ├── env.test.ts
│   ├── exec.test.ts
│   ├── existing-installation.test.ts
│   ├── latest-lts.test.ts
│   ├── latest.test.ts
│   ├── log-level.test.ts
│   ├── multishell.test.ts
│   ├── nvmrc-lts.test.ts
│   ├── old-versions.test.ts
│   ├── shellcode/
│   │   ├── get-stderr.ts
│   │   ├── script.ts
│   │   ├── shells/
│   │   │   ├── cmdCall.ts
│   │   │   ├── cmdEnv.ts
│   │   │   ├── expect-command-output.ts
│   │   │   ├── output-contains.ts
│   │   │   ├── redirect-output.ts
│   │   │   ├── sub-shell.ts
│   │   │   └── types.ts
│   │   ├── shells.ts
│   │   ├── test-bin-dir.ts
│   │   ├── test-cwd.ts
│   │   ├── test-node-version.ts
│   │   └── test-tmp-dir.ts
│   ├── system-node.test.ts
│   ├── uninstall.test.ts
│   ├── use-on-cd.test.ts
│   └── windows-scoop.test.ts
├── fnm-manifest.rc
├── fnm.manifest
├── jest.config.cjs
├── jest.global-setup.js
├── jest.global-teardown.js
├── package.json
├── renovate.json
├── rust-toolchain.toml
├── site/
│   ├── package.json
│   └── vercel.json
├── src/
│   ├── alias.rs
│   ├── arch.rs
│   ├── archive/
│   │   ├── extract.rs
│   │   ├── mod.rs
│   │   ├── tar.rs
│   │   └── zip.rs
│   ├── choose_version_for_user_input.rs
│   ├── cli.rs
│   ├── commands/
│   │   ├── alias.rs
│   │   ├── command.rs
│   │   ├── completions.rs
│   │   ├── current.rs
│   │   ├── default.rs
│   │   ├── env.rs
│   │   ├── exec.rs
│   │   ├── install.rs
│   │   ├── ls_local.rs
│   │   ├── ls_remote.rs
│   │   ├── mod.rs
│   │   ├── unalias.rs
│   │   ├── uninstall.rs
│   │   └── use.rs
│   ├── config.rs
│   ├── current_version.rs
│   ├── default_version.rs
│   ├── directories.rs
│   ├── directory_portal.rs
│   ├── downloader.rs
│   ├── fs.rs
│   ├── http.rs
│   ├── installed_versions.rs
│   ├── log_level.rs
│   ├── lts.rs
│   ├── main.rs
│   ├── package_json.rs
│   ├── path_ext.rs
│   ├── pretty_serde.rs
│   ├── progress.rs
│   ├── remote_node_index.rs
│   ├── shell/
│   │   ├── bash.rs
│   │   ├── fish.rs
│   │   ├── infer/
│   │   │   ├── mod.rs
│   │   │   ├── unix.rs
│   │   │   └── windows.rs
│   │   ├── mod.rs
│   │   ├── powershell.rs
│   │   ├── shell.rs
│   │   ├── windows_cmd/
│   │   │   ├── cd.cmd
│   │   │   └── mod.rs
│   │   ├── windows_compat.rs
│   │   └── zsh.rs
│   ├── system_info.rs
│   ├── system_version.rs
│   ├── user_version.rs
│   ├── user_version_reader.rs
│   ├── version.rs
│   ├── version_file_strategy.rs
│   └── version_files.rs
├── tests/
│   └── proxy-server/
│       └── index.mjs
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .changeset/README.md
================================================
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)


================================================
FILE: .changeset/brave-timers-move.md
================================================
---
"fnm": patch
---

support `x64-glibc-217` arch by adding a `--arch x64-glibc-217` to fnm env


================================================
FILE: .changeset/config.json
================================================
{
  "$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
  "changelog": ["@changesets/changelog-github", { "repo": "Schniz/fnm" }],
  "commit": false,
  "fixed": [],
  "linked": [],
  "access": "restricted",
  "baseBranch": "master",
  "updateInternalDependencies": "patch",
  "ignore": []
}


================================================
FILE: .changeset/cuddly-cars-ring.md
================================================
---
"fnm": patch
---

prefer explicit shell flags in installer-generated shell setup and fix ARM installer CI platform selection


================================================
FILE: .changeset/fair-carrots-greet.md
================================================
---
"fnm": patch
---

Clarify the interactive `fnm use` missing-version prompt by prefixing the message with `fnm` so it is obvious which tool is asking to install Node.


================================================
FILE: .ci/get_shell_profile.sh
================================================
#!/bin/bash

case $1 in
  "fish")
    echo "$HOME/.config/fish/conf.d/fnm.fish"
    ;;
  "zsh")
    echo "$HOME/.zshrc"
    ;;
  "bash")
    OS="$(uname -s)"
    if [ "$OS" = "Darwin" ]; then
      echo "$HOME/.profile"
    else
      echo "$HOME/.bashrc"
    fi
    ;;
  *)
    exit 1
    ;;
esac


================================================
FILE: .ci/install.sh
================================================
#!/bin/bash

set -e

RELEASE="latest"
OS="$(uname -s)"

case "${OS}" in
   MINGW* | Win*) OS="Windows" ;;
esac

if [ -d "$HOME/.fnm" ]; then
  INSTALL_DIR="$HOME/.fnm"
elif [ -n "$XDG_DATA_HOME" ]; then
  INSTALL_DIR="$XDG_DATA_HOME/fnm"
elif [ "$OS" = "Darwin" ]; then
  INSTALL_DIR="$HOME/Library/Application Support/fnm"
else
  INSTALL_DIR="$HOME/.local/share/fnm"
fi

# Parse Flags
parse_args() {
  while [[ $# -gt 0 ]]; do
    key="$1"

    case $key in
    -d | --install-dir)
      INSTALL_DIR="$2"
      shift # past argument
      shift # past value
      ;;
    -s | --skip-shell)
      SKIP_SHELL="true"
      shift # past argument
      ;;
    --force-install | --force-no-brew)
      echo "\`--force-install\`: I hope you know what you're doing." >&2
      FORCE_INSTALL="true"
      shift
      ;;
    -r | --release)
      RELEASE="$2"
      shift # past release argument
      shift # past release value
      ;;
    *)
      echo "Unrecognized argument $key"
      exit 1
      ;;
    esac
  done
}

set_filename() {
  if [ "$OS" = "Linux" ]; then
    # Based on https://stackoverflow.com/a/45125525
    case "$(uname -m)" in
      arm | armv7*)
        FILENAME="fnm-arm32"
        ;;
      aarch* | armv8*)
        FILENAME="fnm-arm64"
        ;;
      *)
        FILENAME="fnm-linux"
    esac
  elif [ "$OS" = "Darwin" ] && [ "$FORCE_INSTALL" = "true" ]; then
    FILENAME="fnm-macos"
    USE_HOMEBREW="false"
    echo "Downloading the latest fnm binary from GitHub..."
    echo "  Pro tip: it's easier to use Homebrew for managing fnm in macOS."
    echo "           Remove the \`--force-no-brew\` so it will be easy to upgrade."
  elif [ "$OS" = "Darwin" ]; then
    USE_HOMEBREW="true"
    echo "Downloading fnm using Homebrew..."
  elif [ "$OS" = "Windows" ] ; then
    FILENAME="fnm-windows"
    echo "Downloading the latest fnm binary from GitHub..."
  else
    echo "OS $OS is not supported."
    echo "If you think that's a bug - please file an issue to https://github.com/Schniz/fnm/issues"
    exit 1
  fi
}

download_fnm() {
  if [ "$USE_HOMEBREW" = "true" ]; then
    brew install fnm
    INSTALL_DIR="$(brew --prefix fnm)/bin"
  else
    if [ "$RELEASE" = "latest" ]; then
      URL="https://github.com/Schniz/fnm/releases/latest/download/$FILENAME.zip"
    else
      URL="https://github.com/Schniz/fnm/releases/download/$RELEASE/$FILENAME.zip"
    fi

    DOWNLOAD_DIR=$(mktemp -d)

    echo "Downloading $URL..."

    mkdir -p "$INSTALL_DIR" &>/dev/null

    if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/$FILENAME.zip"; then
      echo "Download failed.  Check that the release/filename are correct."
      exit 1
    fi

    unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR"

    if [ -f "$DOWNLOAD_DIR/fnm" ]; then
      mv "$DOWNLOAD_DIR/fnm" "$INSTALL_DIR/fnm"
    else
      mv "$DOWNLOAD_DIR/$FILENAME/fnm" "$INSTALL_DIR/fnm"
    fi

    chmod u+x "$INSTALL_DIR/fnm"
  fi
}

check_dependencies() {
  echo "Checking dependencies for the installation script..."

  echo -n "Checking availability of curl... "
  if hash curl 2>/dev/null; then
    echo "OK!"
  else
    echo "Missing!"
    SHOULD_EXIT="true"
  fi

  echo -n "Checking availability of unzip... "
  if hash unzip 2>/dev/null; then
    echo "OK!"
  else
    echo "Missing!"
    SHOULD_EXIT="true"
  fi

  if [ "$USE_HOMEBREW" = "true" ]; then
    echo -n "Checking availability of Homebrew (brew)... "
    if hash brew 2>/dev/null; then
      echo "OK!"
    else
      echo "Missing!"
      SHOULD_EXIT="true"
    fi
  fi

  if [ "$SHOULD_EXIT" = "true" ]; then
    echo "Not installing fnm due to missing dependencies."
    exit 1
  fi
}

ensure_containing_dir_exists() {
  local CONTAINING_DIR
  CONTAINING_DIR="$(dirname "$1")"
  if [ ! -d "$CONTAINING_DIR" ]; then
    echo " >> Creating directory $CONTAINING_DIR"
    mkdir -p "$CONTAINING_DIR"
  fi
}

setup_shell() {
  CURRENT_SHELL="$(basename "$SHELL")"

  if [ "$CURRENT_SHELL" = "zsh" ]; then
    CONF_FILE=${ZDOTDIR:-$HOME}/.zshrc
    ensure_containing_dir_exists "$CONF_FILE"
    echo "Installing for Zsh. Appending the following to $CONF_FILE:"
    {
      echo ''
      echo '# fnm'
      echo 'FNM_PATH="'"$INSTALL_DIR"'"'
      echo 'if [ -d "$FNM_PATH" ]; then'
      if [ "$USE_HOMEBREW" != "true" ]; then
        echo '  export PATH="$FNM_PATH:$PATH"'
      fi
      echo '  eval "$(fnm env --shell zsh)"'
      echo 'fi'
    } | tee -a "$CONF_FILE"

  elif [ "$CURRENT_SHELL" = "fish" ]; then
    CONF_FILE=$HOME/.config/fish/conf.d/fnm.fish
    ensure_containing_dir_exists "$CONF_FILE"
    echo "Installing for Fish. Appending the following to $CONF_FILE:"
    {
      echo ''
      echo '# fnm'
      echo 'set FNM_PATH "'"$INSTALL_DIR"'"'
      echo 'if [ -d "$FNM_PATH" ]'
      if [ "$USE_HOMEBREW" != "true" ]; then
        echo '  set PATH "$FNM_PATH" $PATH'
      fi
      echo '  fnm env --shell fish | source'
      echo 'end'
    } | tee -a "$CONF_FILE"

  elif [ "$CURRENT_SHELL" = "bash" ]; then
    if [ "$OS" = "Darwin" ]; then
      CONF_FILE=$HOME/.profile
    else
      CONF_FILE=$HOME/.bashrc
    fi
    ensure_containing_dir_exists "$CONF_FILE"
    echo "Installing for Bash. Appending the following to $CONF_FILE:"
    {
      echo ''
      echo '# fnm'
      echo 'FNM_PATH="'"$INSTALL_DIR"'"'
      echo 'if [ -d "$FNM_PATH" ]; then'
      if [ "$USE_HOMEBREW" != "true" ]; then
        echo '  export PATH="$FNM_PATH:$PATH"'
      fi
      echo '  eval "$(fnm env --shell bash)"'
      echo 'fi'
    } | tee -a "$CONF_FILE"

  else
    echo "Could not infer shell type. Please set up manually."
    exit 1
  fi

  echo ""
  echo "In order to apply the changes, open a new terminal or run the following command:"
  echo ""
  echo "  source $CONF_FILE"
}

parse_args "$@"
set_filename
check_dependencies
download_fnm
if [ "$SKIP_SHELL" != "true" ]; then
  setup_shell
fi


================================================
FILE: .ci/prepare-static-build.sh
================================================
sed -i 's@"flags": \[\]@"flags": ["-ccopt", "-static"]@' package.json


================================================
FILE: .ci/prepare-version.js
================================================
#!/usr/bin/env node

/// @ts-check

import fs from "fs"
import cp from "child_process"
import cmd from "cmd-ts"
import toml from "toml"
import assert from "assert"

const CARGO_TOML_PATH = new URL("../Cargo.toml", import.meta.url).pathname

const command = cmd.command({
  name: "prepare-version",
  description: "Prepare a new fnm version",
  args: {},
  async handler({}) {
    updateCargoToml(await getPackageVersion())
    exec("cargo build --release")
    exec("pnpm generate-command-docs --binary-path=./target/release/fnm")
    exec("./.ci/record_screen.sh")
  },
})

cmd.run(cmd.binary(command), process.argv)

//////////////////////
// Helper functions //
//////////////////////

/**
 * @returns {Promise<string>}
 */
async function getPackageVersion() {
  const pkgJson = await fs.promises.readFile(
    new URL("../package.json", import.meta.url),
    "utf8"
  )
  const version = JSON.parse(pkgJson).version
  assert(version, "package.json version is not set")
  return version
}

function updateCargoToml(nextVersion) {
  const cargoToml = fs.readFileSync(CARGO_TOML_PATH, "utf8")
  const cargoTomlContents = toml.parse(cargoToml)
  const currentVersion = cargoTomlContents.package.version

  const newToml = cargoToml.replace(
    `version = "${currentVersion}"`,
    `version = "${nextVersion}"`
  )

  if (newToml === cargoToml) {
    console.error("Cargo.toml didn't change, error!")
    process.exitCode = 1
    return
  }

  fs.writeFileSync(CARGO_TOML_PATH, newToml, "utf8")

  return nextVersion
}

function exec(command, env) {
  console.log(`$ ${command}`)
  return cp.execSync(command, {
    cwd: new URL("..", import.meta.url),
    stdio: "inherit",
    env: { ...process.env, ...env },
  })
}


================================================
FILE: .ci/print-command-docs.js
================================================
#!/usr/bin/env node

/// @ts-check

import { execa } from "execa"
import fs from "node:fs"
import cmd from "cmd-ts"
import cmdFs from "cmd-ts/dist/cjs/batteries/fs.js"

const FnmBinaryPath = {
  ...cmdFs.ExistingPath,
  defaultValue() {
    const target = new URL("../target/debug/fnm", import.meta.url)
    if (!fs.existsSync(target)) {
      throw new Error(
        "Can't find debug target, please run `cargo build` or provide a specific binary path"
      )
    }
    return target.pathname
  },
}

const command = cmd.command({
  name: "print-command-docs",
  description: "prints the docs/command.md file with updated contents",
  args: {
    checkForDirty: cmd.flag({
      long: "check",
      description: `Check that file was not changed`,
    }),
    fnmPath: cmd.option({
      long: "binary-path",
      description: "the fnm binary path",
      type: FnmBinaryPath,
    }),
  },
  async handler({ checkForDirty, fnmPath }) {
    const targetFile = new URL("../docs/commands.md", import.meta.url).pathname
    await main(targetFile, fnmPath)
    if (checkForDirty) {
      const gitStatus = await checkGitStatus(targetFile)
      if (gitStatus.state === "dirty") {
        process.exitCode = 1
        console.error(
          "The file has changed. Please re-run `pnpm generate-command-docs`."
        )
        console.error(`hint: The following diff was found:`)
        console.error()
        console.error(gitStatus.diff)
      }
    }
  },
})

cmd.run(cmd.binary(command), process.argv).catch((err) => {
  console.error(err)
  process.exitCode = process.exitCode || 1
})

/**
 * @param {string} targetFile
 * @param {string} fnmPath
 * @returns {Promise<void>}
 */
async function main(targetFile, fnmPath) {
  const stream = fs.createWriteStream(targetFile)

  const { subcommands, text: mainText } = await getCommandHelp(fnmPath)

  await write(stream, line(`fnm`, mainText))

  for (const subcommand of subcommands) {
    const { text: subcommandText } = await getCommandHelp(fnmPath, subcommand)
    await write(stream, "\n" + line(`fnm ${subcommand}`, subcommandText))
  }

  stream.close()

  await execa(`pnpm`, ["prettier", "--write", targetFile])
}

/**
 * @param {import('stream').Writable} stream
 * @param {string} content
 * @returns {Promise<void>}
 */
function write(stream, content) {
  return new Promise((resolve, reject) => {
    stream.write(content, (err) => (err ? reject(err) : resolve()))
  })
}

function line(cmd, text) {
  const cmdCode = "`" + cmd + "`"
  const textCode = "```\n" + text + "\n```"
  return `# ${cmdCode}\n${textCode}`
}

/**
 * @param {string} fnmPath
 * @param {string} [command]
 * @returns {Promise<{ subcommands: string[], text: string }>}
 */
async function getCommandHelp(fnmPath, command) {
  const cmdArg = command ? [command] : []
  const result = await run(fnmPath, [...cmdArg, "--help"])
  const text = result.stdout
  const rows = text.split("\n")
  const headerIndex = rows.findIndex((x) => x.includes("Commands:"))
  /** @type {string[]} */
  const subcommands = []
  if (!command) {
    for (const row of rows.slice(
      headerIndex + 1,
      rows.indexOf("", headerIndex + 1)
    )) {
      const [, word] = row.split(/\s+/)
      if (word && word[0].toLowerCase() === word[0]) {
        subcommands.push(word)
      }
    }
  }
  return {
    subcommands,
    text,
  }
}

/**
 * @param {string[]} args
 * @returns {import('execa').ExecaChildProcess<string>}
 */
function run(fnmPath, args) {
  return execa(fnmPath, args, {
    reject: false,
    stdout: "pipe",
    stderr: "pipe",
  })
}

/**
 * @param {string} targetFile
 * @returns {Promise<{ state: "dirty", diff: string } | { state: "clean" }>}
 */
async function checkGitStatus(targetFile) {
  const { stdout, exitCode } = await execa(
    `git`,
    ["diff", "--color", "--exit-code", targetFile],
    {
      reject: false,
    }
  )
  if (exitCode === 0) {
    return { state: "clean" }
  }
  return { state: "dirty", diff: stdout }
}


================================================
FILE: .ci/record_screen.sh
================================================
#!/bin/bash

DIRECTORY="$(dirname "$0")"

function setup_binary() {
  TEMP_DIR="/tmp/fnm-$(date '+%s')"
  mkdir "$TEMP_DIR"
  cp ./target/release/fnm "$TEMP_DIR/fnm"
  export PATH=$TEMP_DIR:$PATH
  export FNM_DIR=$TEMP_DIR/.fnm

  # First run of the binary might be slower due to anti-virus software
  echo "Using $(which fnm)"
  echo "  with version $(fnm --version)"
}

setup_binary

RECORDING_PATH=$DIRECTORY/screen_recording

(rm -rf "$RECORDING_PATH" &> /dev/null || true)

asciinema rec \
  --command "$DIRECTORY/recorded_screen_script.sh" \
  --cols 70 \
  --rows 17 \
  "$RECORDING_PATH"
sed "s@$TEMP_DIR@~@g" "$RECORDING_PATH" | \
  svg-term \
    --window \
    --out "docs/fnm.svg" \
    --height=17 \
    --width=70


================================================
FILE: .ci/recorded_screen_script.sh
================================================
#!/bin/bash

set -e

export PATH=$PATH_ADDITION:$PATH

GAL_PROMPT_PREFIX="\e[34m✡\e[m  "

function type() {
  printf $GAL_PROMPT_PREFIX
  echo -n " "
  echo $* | node .ci/type-letters.js
}

type 'eval "$(fnm env)"'
eval "$(fnm env)"

type 'fnm --version'
fnm --version

type 'cat .node-version'
cat .node-version

type 'fnm install'
fnm install

type 'fnm use'
fnm use

type 'node -v'
node -v

sleep 2
echo ""


================================================
FILE: .ci/test_installation_script.sh
================================================
#!/bin/bash

set -e

DIRECTORY="$(dirname "$0")"
SHELL_TO_RUN="$1"
PROFILE_FILE="$("$DIRECTORY/get_shell_profile.sh" "$SHELL_TO_RUN")"

ls -lah ~
echo "---"
echo "Profile is $PROFILE_FILE"
echo "---"
cat "$PROFILE_FILE"
echo "---"
echo "PATH=$PATH"
echo "---"

$SHELL_TO_RUN -c "
  . $PROFILE_FILE
  fnm --version
"

$SHELL_TO_RUN -c "
  . $PROFILE_FILE
  fnm install 12.5.0
  fnm ls | grep 12.5.0

  echo 'fnm ls worked.'
"

$SHELL_TO_RUN -c "
  . $PROFILE_FILE
  fnm use 12.5.0
  node --version | grep 12.5.0

  echo 'node --version worked.'
"


================================================
FILE: .ci/type-letters.js
================================================
(async () => {
  for await (const chunk of process.stdin) {
    const letters = chunk.toString("utf8").split("");
    for (const letter of letters) {
      process.stdout.write(letter);
      await sleep(Math.random() * 100 + 20);
    }
  }
})();

function sleep(ms) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}


================================================
FILE: .gitattributes
================================================
*__Fish.snap linguist-language=fish
*__Zsh.snap linguist-language=Shell
*__Bash.snap linguist-language=Shell
*__PowerShell.snap linguist-language=PowerShell
*__WinCmd.snap linguist-language=Batchfile


================================================
FILE: .github/workflows/debug.yml
================================================
name: "debug"

on:
  workflow_dispatch:

concurrency:
  group: debug
  cancel-in-progress: true

jobs:
  e2e_windows_debug:
    runs-on: windows-latest
    name: "e2e/windows/debug"
    steps:
    - uses: actions/checkout@v4
      with:
        ref: ${{ github.event.inputs.commit_hash }}
    - name: Download artifact
      id: download-artifact
      uses: dawidd6/action-download-artifact@v6
      with:
        workflow: rust.yml
        workflow_conclusion: ""
        branch: ${{ env.GITHUB_REF }}
        name: "fnm-windows"
        path: "target/release"
        if_no_artifact_found: ignore
    - uses: hecrj/setup-rust-action@v1
      if: steps.download-artifact.outputs.artifact-found == false
      with:
        rust-version: stable
    - uses: Swatinem/rust-cache@v2
      if: steps.download-artifact.outputs.artifact-found == false
    - name: Build release binary
      if: steps.download-artifact.outputs.artifact-found == false
      run: cargo build --release
      env:
        RUSTFLAGS: "-C target-feature=+crt-static"
    - uses: pnpm/action-setup@v4.0.0
      with:
        run_install: false
    - uses: actions/setup-node@v4
      with:
        node-version: 16.x
        cache: 'pnpm'
    - name: Get pnpm store directory
      id: pnpm-cache
      run: |
        echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
    - uses: actions/cache@v4
      name: Setup pnpm cache
      with:
        path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
        key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
        restore-keys: |
          ${{ runner.os }}-pnpm-store-
    - run: pnpm install
    - name: 🐛 Debug Build
      if: always()
      uses: mxschmitt/action-tmate@v3
      with:
        limit-access-to-actor: true


================================================
FILE: .github/workflows/installation_script.yml
================================================
name: Installation script
on:
  pull_request:
    paths:
      - .ci/install.sh
  push:
    branches:
      - master
    paths:
      - .ci/install.sh

jobs:
  test_against_latest_release_arm:
    strategy:
      matrix:
        include:
          - docker_image: arm64v8/ubuntu
            docker_platform: linux/arm64/v8
          - docker_image: arm32v7/ubuntu
            docker_platform: linux/arm/v7
    name: Test against latest release (ARM)
    runs-on: ubuntu-latest
    steps:
      - name: Set up QEMU
        id: qemu
        uses: docker/setup-qemu-action@v3
      - uses: actions/checkout@v4
      - name: Run installation script in Docker
        run: |
          docker run --rm --platform ${{ matrix.docker_platform }} -v $(pwd):$(pwd) -e "RUST_LOG=fnm=debug" --workdir $(pwd) ${{matrix.docker_image}} bash -c '
            set -e

            apt update && apt install -y unzip curl libatomic1

            echo "-------------------------------------"
            echo "Installing for CPU arch: $(uname -m)"

            bash ./.ci/install.sh

            echo "fnm --version"
            ~/.local/share/fnm/fnm --version

            echo "eval fnm env"
            eval "$(~/.local/share/fnm/fnm env)"

            echo "fnm install"
            ~/.local/share/fnm/fnm install 12

            echo "node -v"
            ~/.local/share/fnm/fnm exec --using=12 -- node -v
          '

  test_against_latest_release:
    name: Test against latest release
    strategy:
      matrix:
        shell: [fish, zsh, bash]
        setup:
          - os: ubuntu
            script_arguments: ""
          - os: macos
            script_arguments: ""
          - os: macos
            script_arguments: "--force-no-brew"
    runs-on: ${{ matrix.setup.os }}-latest
    steps:
      - uses: actions/checkout@v4
      - run: "sudo apt-get install -y ${{ matrix.shell }}"
        name: Install ${{matrix.shell}} using apt-get
        if: matrix.setup.os == 'ubuntu'
      - run: "brew update && brew install ${{ matrix.shell }}"
        name: Update formulae and install ${{matrix.shell}} using Homebrew
        if: matrix.setup.os == 'macos'
      - run: |
          if [ -f ~/.bashrc ]; then
            cp ~/.bashrc ~/.bashrc.bak
            echo 'echo hello world' > ~/.bashrc
            echo '. ~/.bashrc.bak' >> ~/.bashrc
          fi

          if [ -f ~/.zshrc ]; then
            echo 'echo hello world' > ~/.zshrc
            echo '. ~/.zshrc.bak' >> ~/.zshrc
          fi
        name: reset shell profiles
      - run: "env SHELL=$(which ${{ matrix.shell }}) bash ./.ci/install.sh ${{ matrix.setup.script_arguments }}"
        name: Run the installation script
      - run: ./.ci/test_installation_script.sh ${{ matrix.shell }}
        name: "Test installation script"


================================================
FILE: .github/workflows/release-to-cargo.yml
================================================
name: release to cargo
on:
  workflow_dispatch:
  push:
    tags: ['*']
jobs:
  publish_to_crates_io:
    runs-on: ubuntu-latest
    name: Publish to crates.io
    steps:
      # set up
      - uses: actions/checkout@v4

      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: stable

      - uses: Swatinem/rust-cache@v2

      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false

      - name: Publish to crates.io
        run: cargo publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          TERM: xterm


================================================
FILE: .github/workflows/release.yml
================================================
name: release
on:
  push:
    branches:
      - master
      - main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
  create_pull_request:
    runs-on: ubuntu-latest
    steps:
      # set up
      - uses: actions/checkout@v4

      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: stable

      - uses: Swatinem/rust-cache@v2

      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false

      # pnpm
      - uses: actions/setup-node@v4
        with:
          node-version: 20.x
          cache: "pnpm"

      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

      - name: Install Asciinema
        run: |
          pipx install asciinema

      - name: Install Node.js project dependencies
        run: pnpm install

      - name: Create Release Pull Request
        uses: changesets/action@v1
        with:
          version: "pnpm version:prepare"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          TERM: xterm


================================================
FILE: .github/workflows/rust.yml
================================================
name: Rust

on:
  pull_request:
  push:
    branches:
      - master

concurrency:
  group: ci-${{ github.head_ref }}
  cancel-in-progress: true

env:
  RUST_VERSION: "1.88"

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
      - uses: Swatinem/rust-cache@v2
      - name: cargo fmt
        run: cargo fmt -- --check

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
      - uses: Swatinem/rust-cache@v2
      - name: cargo clippy
        run: cargo clippy -- -D warnings

  unit_tests:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
      - uses: Swatinem/rust-cache@v2
      - name: Run tests
        run: cargo test

  build_release:
    runs-on: windows-latest
    name: "Release build for Windows"
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
      - uses: Swatinem/rust-cache@v2
      - name: Build release binary
        run: cargo build --release
        env:
          RUSTFLAGS: "-C target-feature=+crt-static"
      - uses: actions/upload-artifact@v4
        with:
          name: fnm-windows
          path: target/release/fnm.exe

  build_macos_release:
    runs-on: macos-latest
    name: "Release build for macOS"
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
          targets: x86_64-apple-darwin,aarch64-apple-darwin
      - uses: Swatinem/rust-cache@v2
      - name: Build release binary
        run: |
          cargo build --release --target x86_64-apple-darwin
          strip target/x86_64-apple-darwin/release/fnm
          cargo build --release --target aarch64-apple-darwin
          strip target/aarch64-apple-darwin/release/fnm

          mkdir -p target/release

          # create a universal binary
          lipo -create \
            target/x86_64-apple-darwin/release/fnm \
            target/aarch64-apple-darwin/release/fnm \
            -output target/release/fnm
        env:
          LZMA_API_STATIC: "true"
      - name: Strip binary from debug symbols
        run: strip target/release/fnm
      - name: List dynamically linked libraries
        run: otool -L target/release/fnm
      - uses: actions/upload-artifact@v4
        with:
          name: fnm-macos
          path: target/release/fnm

  e2e_macos:
    runs-on: macos-latest
    needs: [build_macos_release]
    name: "e2e/macos"
    steps:
      - uses: actions/checkout@v4
      - name: install necessary shells
        run: brew install fish zsh bash
      - uses: actions/download-artifact@v4
        with:
          name: fnm-macos
          path: target/release
      - name: mark binary as executable
        run: chmod +x target/release/fnm
      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false
      - uses: actions/setup-node@v4
        with:
          node-version: 18.x
          cache: "pnpm"
      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-
      - run: pnpm install
      - run: pnpm test
        env:
          FNM_TARGET_NAME: "release"
          FORCE_COLOR: "1"

  e2e_windows:
    runs-on: windows-latest
    needs: [build_release]
    name: "e2e/windows"
    steps:
      - uses: actions/checkout@v4
      - uses: actions/download-artifact@v4
        with:
          name: fnm-windows
          path: target/release
      - uses: MinoruSekine/setup-scoop@v4
      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false
      - uses: actions/setup-node@v4
        with:
          node-version: 18.x
          cache: "pnpm"
      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-
      - run: pnpm install
      - run: pnpm test
        env:
          FNM_TARGET_NAME: "release"
          FORCE_COLOR: "1"

  # e2e_windows_debug:
  #   runs-on: windows-latest
  #   name: "e2e/windows/debug"
  #   environment: Debug
  #   needs: [e2e_windows]
  #   if: contains(join(needs.*.result, ','), 'failure')
  #   steps:
  #   - uses: actions/checkout@v3
  #   - uses: actions/download-artifact@v3
  #     with:
  #       name: fnm-windows
  #       path: target/release
  #   - uses: pnpm/action-setup@v2.2.2
  #     with:
  #       run_install: false
  #   - uses: actions/setup-node@v3
  #     with:
  #       node-version: 18.x
  #       cache: 'pnpm'
  #   - name: Get pnpm store directory
  #     id: pnpm-cache
  #     run: |
  #       echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
  #   - uses: actions/cache@v3
  #     name: Setup pnpm cache
  #     with:
  #       path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
  #       key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  #       restore-keys: |
  #         ${{ runner.os }}-pnpm-store-
  #   - run: pnpm install
  #   - name: 🐛 Debug Build
  #     uses: mxschmitt/action-tmate@v3

  e2e_linux:
    runs-on: ubuntu-latest
    needs: [build_static_linux_binary]
    name: "e2e/linux"
    steps:
      - uses: actions/checkout@v4
      - name: install necessary shells
        run: sudo apt-get update && sudo apt-get install -y fish zsh bash
      - uses: actions/download-artifact@v4
        with:
          name: fnm-linux
          path: target/release
      - name: mark binary as executable
        run: chmod +x target/release/fnm
      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false
      - uses: actions/setup-node@v4
        with:
          node-version: 18.x
          cache: "pnpm"
      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-
      - run: pnpm install
      - run: pnpm test
        env:
          FNM_TARGET_NAME: "release"
          FORCE_COLOR: "1"

  build_static_linux_binary:
    name: "Build static Linux binary"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
          targets: x86_64-unknown-linux-musl
      - uses: Swatinem/rust-cache@v2
        with:
          key: static-linux-binary
      - name: Install musl tools
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends musl-tools
      - name: Build release binary
        run: cargo build --release --target x86_64-unknown-linux-musl
      - name: Strip binary from debug symbols
        run: strip target/x86_64-unknown-linux-musl/release/fnm
      - uses: actions/upload-artifact@v4
        with:
          name: fnm-linux
          path: target/x86_64-unknown-linux-musl/release/fnm

  build_static_arm_binary:
    name: "Build ARM binary"
    strategy:
      matrix:
        include:
          - arch: arm64
            rust_target: aarch64-unknown-linux-musl
            docker_image: arm64v8/ubuntu
            docker_platform: aarch64
          - arch: arm32
            rust_target: armv7-unknown-linux-gnueabihf
            docker_image: arm32v7/ubuntu
            docker_platform: armv7
    runs-on: ubuntu-latest
    env:
      RUST_TARGET: ${{ matrix.rust_target }}
    steps:
      - uses: actions/checkout@v4
      - name: Set up QEMU
        id: qemu
        uses: docker/setup-qemu-action@v3
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{env.RUST_VERSION}}
      - uses: Swatinem/rust-cache@v2
        with:
          key: arm-binary-${{ matrix.arch }}
      - name: "Download `cross` crate"
        run: cargo install cross
      - name: "Build release"
        run: cross build --target $RUST_TARGET --release
      - uses: uraimo/run-on-arch-action@v2.1.2
        name: Sanity test
        with:
          arch: ${{matrix.docker_platform}}
          distro: ubuntu18.04

          # Not required, but speeds up builds by storing container images in
          # a GitHub package registry.
          githubToken: ${{ github.token }}

          env: |
            RUST_LOG: fnm=debug

          dockerRunArgs: |
            --volume "${PWD}/target/${{matrix.rust_target}}/release:/artifacts"

          # Set an output parameter `uname` for use in subsequent steps
          run: |
            echo "Hello from $(uname -a)"
            /artifacts/fnm --version
            echo "fnm install 12.0.0"
            /artifacts/fnm install 12.0.0
            echo "fnm exec --using=12 -- node --version"
            /artifacts/fnm exec --using=12 -- node --version

      - uses: actions/upload-artifact@v4
        with:
          name: fnm-${{ matrix.arch }}
          path: target/${{ env.RUST_TARGET }}/release/fnm

  ensure_commands_markdown_is_up_to_date:
    runs-on: ubuntu-latest
    name: Ensure command docs are up-to-date
    needs: [build_static_linux_binary]
    steps:
      - uses: actions/checkout@v4
      - name: install necessary shells
        run: sudo apt-get update && sudo apt-get install -y fish zsh bash
      - uses: actions/download-artifact@v4
        with:
          name: fnm-linux
          path: target/release
      - name: mark binary as executable
        run: chmod +x target/release/fnm
      - name: install fnm as binary
        run: |
          sudo install target/release/fnm /bin
          fnm --version
      - uses: pnpm/action-setup@v4.0.0
        with:
          run_install: false
      - uses: actions/setup-node@v4
        with:
          node-version: 18.x
          cache: "pnpm"
      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
      - uses: actions/cache@v4
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-
      - run: pnpm install
      - name: Generate command markdown
        run: |
          pnpm run generate-command-docs --check --binary-path=$(which fnm)

      # TODO: use bnz
      # run_e2e_benchmarks:
      #   runs-on: ubuntu-latest
      #   name: bench/linux
      #   needs: [build_static_linux_binary]
      #   permissions:
      #     contents: write
      #     pull-requests: write
      #   steps:
      #     - name: install necessary shells
      #       run: sudo apt-get update && sudo apt-get install -y fish zsh bash hyperfine
      #     - uses: actions/checkout@v3
      #     - uses: actions/download-artifact@v3
      #       with:
      #         name: fnm-linux
      #         path: target/release
      #     - name: mark binary as executable
      #       run: chmod +x target/release/fnm
      #     - name: install fnm as binary
      #       run: |
      #         sudo install target/release/fnm /bin
      #         fnm --version
      #     - uses: pnpm/action-setup@v2.2.4
      #       with:
      #         run_install: false
      #     - uses: actions/setup-node@v3
      #       with:
      #         node-version: 18.x
      #         cache: "pnpm"
      #     - name: Get pnpm store directory
      #       id: pnpm-cache
      #       run: |
      #         echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
      #     - uses: actions/cache@v3
      #       name: Setup pnpm cache
      #       with:
      #         path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
      #         key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
      #         restore-keys: |
      #           ${{ runner.os }}-pnpm-store-
      #     - run: pnpm install
      #     - name: Run benchmarks
      #       env:
      #         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      #         SHOULD_STORE: ${{ toJson(!github.event.pull_request) }}
      #       id: benchmark
      #       run: |
      #         delimiter="$(openssl rand -hex 8)"
      #         echo "markdown<<${delimiter}" >> "${GITHUB_OUTPUT}"
      #         node benchmarks/run.mjs --store=$SHOULD_STORE >> "${GITHUB_OUTPUT}"
      #         echo "${delimiter}" >> "${GITHUB_OUTPUT}"
      # - name: Create a PR comment
      #   if: ${{ github.event.pull_request }}
      #   uses: thollander/actions-comment-pull-request@v2
      #   with:
      #     message: |
      #       ## Linux Benchmarks for ${{ github.event.pull_request.head.sha }}
      #       ${{ steps.benchmark.outputs.markdown }}
      #     comment_tag: "benchy comment"
      #
      # - name: Create a commit comment
      #   if: ${{ !github.event.pull_request }}
      #   uses: peter-evans/commit-comment@v2
      #   with:
      #     body: |
      #       ## Linux Benchmarks
      #       ${{ steps.benchmark.outputs.markdown }}


================================================
FILE: .gitignore
================================================
node_modules/
.ci/screen_recording
/benchmarks/results
/target
**/*.rs.bk
feature_tests/.tmp
*.log
/site/public
.vercel
.proxy


================================================
FILE: .kodiak.toml
================================================
version = 1


================================================
FILE: .node-version
================================================
20.14.0


================================================
FILE: CHANGELOG.md
================================================
## 1.31.0 (2022-02-16)

## 1.39.0

### Minor Changes

- [#1516](https://github.com/Schniz/fnm/pull/1516) [`10c68cb`](https://github.com/Schniz/fnm/commit/10c68cb6630be811799afdccf212a399e08bef99) Thanks [@Schniz](https://github.com/Schniz)! - Reduce shell startup overhead for `env --use-on-cd` by applying the initial version during `fnm env`, instead of requiring an immediate extra `fnm use` subprocess from shell hook output.

- [#1435](https://github.com/Schniz/fnm/pull/1435) [`1ebc90d`](https://github.com/Schniz/fnm/commit/1ebc90decf58c2176dcbd4f8ac00ecb3adb1de12) Thanks [@SunsetTechuila](https://github.com/SunsetTechuila)! - add `use` flag to the `install` command

### Patch Changes

- [#1268](https://github.com/Schniz/fnm/pull/1268) [`ddab191`](https://github.com/Schniz/fnm/commit/ddab1911dc33a24aeec9d2b8139df1916c518d64) Thanks [@isaacl](https://github.com/isaacl)! - Make `fnm default` with no trailing positional argument to return the default version

- [#1517](https://github.com/Schniz/fnm/pull/1517) [`d3747af`](https://github.com/Schniz/fnm/commit/d3747affd604223c752171c14944bd5773096b09) Thanks [@Schniz](https://github.com/Schniz)! - Improve `--use-on-cd` shell hook robustness by de-duplicating the zsh hook on re-source and fixing Windows CMD hook behavior for paths with spaces and drive changes.

- [#1441](https://github.com/Schniz/fnm/pull/1441) [`bc4d19a`](https://github.com/Schniz/fnm/commit/bc4d19a481c11b4182f51683f03a8d366f1208d2) Thanks [@Schniz](https://github.com/Schniz)! - bump Rust toolchain to 1.88

## 1.38.1

### Patch Changes

- [#1326](https://github.com/Schniz/fnm/pull/1326) [`172fb0a`](https://github.com/Schniz/fnm/commit/172fb0adc9d9d78b4763be087769388802c5345d) Thanks [@Schniz](https://github.com/Schniz)! - fix --use-on-cd failing with newly released default of --resolve-engines when `engines` key didn't exist

## 1.38.0

### Minor Changes

- [#1265](https://github.com/Schniz/fnm/pull/1265) [`186e4bb`](https://github.com/Schniz/fnm/commit/186e4bbd9204d7658a4f9923955281687a01e8c3) Thanks [@Schniz](https://github.com/Schniz)! - enable `--resolve-engines` by default. out of experimental phase.

  to disable it, add a `--resolve-engines=false` flag, and make sure to open an issue describing _why_.
  It might feel like a breaking change but .nvmrc and .node-version have precedence so it should not.

  I am all in favor of better experience and I believe supporting engines.node is a good direction.

### Patch Changes

- [#1310](https://github.com/Schniz/fnm/pull/1310) [`9273981`](https://github.com/Schniz/fnm/commit/9273981dc0d78124181927fae8746b5a61901c45) Thanks [@Schniz](https://github.com/Schniz)! - make github releases of macos to be a universal macos executable (both m1 and x64) as github changed the workers to be m1

- [#1277](https://github.com/Schniz/fnm/pull/1277) [`12cf977`](https://github.com/Schniz/fnm/commit/12cf977beb8581000ea84d7b8d1636dc3ae25db3) Thanks [@deanshub](https://github.com/deanshub)! - Having install and uninstall aliases

- [#1318](https://github.com/Schniz/fnm/pull/1318) [`65f7a22`](https://github.com/Schniz/fnm/commit/65f7a22822ce03f07972fe175d08cc60112856f8) Thanks [@Schniz](https://github.com/Schniz)! - better error handling for malformed json

## 1.37.2

### Patch Changes

- [#1264](https://github.com/Schniz/fnm/pull/1264) [`364d2a9`](https://github.com/Schniz/fnm/commit/364d2a939c684fede25c43c6a9c14b7c4c6e3fc5) Thanks [@Schniz](https://github.com/Schniz)! - fix: allow to type powershell and power-shell as shell type inputs

- [#1195](https://github.com/Schniz/fnm/pull/1195) [`74d7c33`](https://github.com/Schniz/fnm/commit/74d7c33da9f5ac53a42633012d775015eb774bcb) Thanks [@mattmess1221](https://github.com/mattmess1221)! - When downloading from node-dist, Fallback to .tar.gz download when the .tar.xz download fails

- [#1259](https://github.com/Schniz/fnm/pull/1259) [`1000914`](https://github.com/Schniz/fnm/commit/10009143460e161b76350eb738652f332e8a893c) Thanks [@skirsten](https://github.com/skirsten)! - Fix `--resolve-engines` in combination with `--use-on-cd`

- [#1248](https://github.com/Schniz/fnm/pull/1248) [`e03d345`](https://github.com/Schniz/fnm/commit/e03d345e9f485c4ab0183a3a542bcba20525fff4) Thanks [@bburns](https://github.com/bburns)! - docs: add link for windows terminal startup script configuration

- [#1184](https://github.com/Schniz/fnm/pull/1184) [`fefdf69`](https://github.com/Schniz/fnm/commit/fefdf69870ddaec0ba59b103aef730dd03e56e4a) Thanks [@julescubtree](https://github.com/julescubtree)! - fix panic when list-remote --filter --latest has no results

- [#1255](https://github.com/Schniz/fnm/pull/1255) [`71c1c9a`](https://github.com/Schniz/fnm/commit/71c1c9a9998f7fd0dc512de6ead9244f03fa532d) Thanks [@stefanboca](https://github.com/stefanboca)! - set aliases during install, even if corepack is enabled

- [#1204](https://github.com/Schniz/fnm/pull/1204) [`19bffe5`](https://github.com/Schniz/fnm/commit/19bffe5af6ee1d624095c94f5ec55660fe69ac3b) Thanks [@JLarky](https://github.com/JLarky)! - Document how to use nightly builds

- [#1218](https://github.com/Schniz/fnm/pull/1218) [`345adaf`](https://github.com/Schniz/fnm/commit/345adafb856e2e0ba8feb8acf487a4669cea4055) Thanks [@Schniz](https://github.com/Schniz)! - internal: retry download in case of error in test proxy

- [#1226](https://github.com/Schniz/fnm/pull/1226) [`8e2d37d`](https://github.com/Schniz/fnm/commit/8e2d37d858b15d965d9644b27f5c111478cc59f2) Thanks [@mo8it](https://github.com/mo8it)! - performance optimizations, especially for `fnm env`

- [#1223](https://github.com/Schniz/fnm/pull/1223) [`2b211ef`](https://github.com/Schniz/fnm/commit/2b211ef64a7eb2ff5fe7ac017d1f963db522b6cf) Thanks [@mo8it](https://github.com/mo8it)! - Allow reading non-unicode paths from environment variables

## 1.37.1

### Patch Changes

- [#1164](https://github.com/Schniz/fnm/pull/1164) [`318f86d`](https://github.com/Schniz/fnm/commit/318f86d72938166cb2b3195cae37826f827b6c08) Thanks [@Schniz](https://github.com/Schniz)! - windows: fix shell inference in powershell when using scoop's shims

## 1.37.0

### Minor Changes

- [#1143](https://github.com/Schniz/fnm/pull/1143) [`f76a001`](https://github.com/Schniz/fnm/commit/f76a0011f7a613bb818e47acd224b7de48c5a81f) Thanks [@Schniz](https://github.com/Schniz)! - use XDG conventions in MacOS directories by default

### Patch Changes

- [#1148](https://github.com/Schniz/fnm/pull/1148) [`0b530cc`](https://github.com/Schniz/fnm/commit/0b530cc257e33e9801804b73ed831a1f28489b57) Thanks [@Schniz](https://github.com/Schniz)! - fix ordering in ls-remote

- [#1133](https://github.com/Schniz/fnm/pull/1133) [`a1afe84`](https://github.com/Schniz/fnm/commit/a1afe8436afb29960b71e14e221441398f6a48ca) Thanks [@Schniz](https://github.com/Schniz)! - upgrade all dependencies & maintain lockfile

## 1.36.0

### Minor Changes

- [#1063](https://github.com/Schniz/fnm/pull/1063) [`121128f`](https://github.com/Schniz/fnm/commit/121128f42bc27583c2cf9a77b14f60f456af4a82) Thanks [@ryanccn](https://github.com/ryanccn)! - feat: add remote version sorting and filtering

- [#896](https://github.com/Schniz/fnm/pull/896) [`7b47b3e`](https://github.com/Schniz/fnm/commit/7b47b3ef0a741fe40a39efaa5eca6945b2e11c59) Thanks [@pedrofialho](https://github.com/pedrofialho)! - `fnm install latest` will now tag the `latest` alias

- [#1028](https://github.com/Schniz/fnm/pull/1028) [`66efc5b`](https://github.com/Schniz/fnm/commit/66efc5b90c71f2f24592dbf8d7e28c9f53bcf5f9) Thanks [@eblocha](https://github.com/eblocha)! - Show a progress bar when downloading and extracting node

### Patch Changes

- [#1014](https://github.com/Schniz/fnm/pull/1014) [`6be23c8`](https://github.com/Schniz/fnm/commit/6be23c868f5ddb2a4508a1f302c345298401d674) Thanks [@tottoto](https://github.com/tottoto)! - Disable unused chrono features (#1014)

- [#1050](https://github.com/Schniz/fnm/pull/1050) [`d6c132a`](https://github.com/Schniz/fnm/commit/d6c132adfd1c29c48acb0b9de42538146e23cf18) Thanks [@JakeHandsome](https://github.com/JakeHandsome)! - Fix `cd /D` on windows with `--use-on-cd`

- [#1109](https://github.com/Schniz/fnm/pull/1109) [`8f3acbb`](https://github.com/Schniz/fnm/commit/8f3acbb8ee4991b838ce3fe146d62864aaa290b9) Thanks [@Vinfall](https://github.com/Vinfall)! - support `x64-musl` arch by adding a `--arch x64-musl` to fnm env

- [#1125](https://github.com/Schniz/fnm/pull/1125) [`d9af62f`](https://github.com/Schniz/fnm/commit/d9af62ff432e57398efdd812e218f3fb390c5243) Thanks [@Schniz](https://github.com/Schniz)! - make nicer styling in progress bar (add newline, make it unicode)

- [#1058](https://github.com/Schniz/fnm/pull/1058) [`734df47`](https://github.com/Schniz/fnm/commit/734df47795c3b71d104ec9638034447cc4ef47cc) Thanks [@aquacash5](https://github.com/aquacash5)! - fix: return default version if canonicalize fails

- [#1066](https://github.com/Schniz/fnm/pull/1066) [`9ff98da`](https://github.com/Schniz/fnm/commit/9ff98da93c69013274322c3a63dfdb1beaf73875) Thanks [@floh1695](https://github.com/floh1695)! - Fixes a bug when running `eval $(fnm env)` in sh when there a spaces in the $PATH

## 1.35.1

### Patch Changes

- [#1010](https://github.com/Schniz/fnm/pull/1010) [`b185446`](https://github.com/Schniz/fnm/commit/b185446cfa08d4d6e2552db53937762a3c38d4db) Thanks [@quixoten](https://github.com/quixoten)! - fix: panic on `fnm completions`

## 1.35.0

### Minor Changes

- [#839](https://github.com/Schniz/fnm/pull/839) [`97be792`](https://github.com/Schniz/fnm/commit/97be792a4410d8f121e03a1f81f60c48cbfdee2c) Thanks [@amitdahan](https://github.com/amitdahan)! - Support resolving `engines.node` field via experimental `--resolve-engines` flag

### Patch Changes

- [#991](https://github.com/Schniz/fnm/pull/991) [`b19eb29`](https://github.com/Schniz/fnm/commit/b19eb29b26323f0b9fb427d3d9271c9cc13a58f8) Thanks [@amitdahan](https://github.com/amitdahan)! - Bump Clap 3 -> 4

## 1.34.0

### Minor Changes

- Add --corepack-enabled flag for automatically enabling corepack on fnm install ([#960](https://github.com/Schniz/fnm/pull/960))

### Patch Changes

- modernize tty check (#973 by @tottoto) ([`48b2611`](https://github.com/Schniz/fnm/commit/48b2611e4b1c205f07dcbd50f2fff436becb77c1))

- use cygwinpath to make the path posix-like on Windows Bash usage ([#960](https://github.com/Schniz/fnm/pull/960))

- capitalize "n" to show default (#963 by @Joshuahuahua) ([`48b2611`](https://github.com/Schniz/fnm/commit/48b2611e4b1c205f07dcbd50f2fff436becb77c1))

## 1.33.1

### Patch Changes

- remove upx compression from arm binaries because it fails to build on latest rust ([#875](https://github.com/Schniz/fnm/pull/875))

## 1.33.0

### Minor Changes

- Replace `semver` with `node_semver` ([#816](https://github.com/Schniz/fnm/pull/816))

- support `fnm install --latest` to install the latest Node.js version ([#859](https://github.com/Schniz/fnm/pull/859))

## 1.32.0

### Minor Changes

- Add `--json` to `fnm env` to output the env vars as JSON ([#800](https://github.com/Schniz/fnm/pull/800))

### Patch Changes

- This updates the Changesets configurations. ([#783](https://github.com/Schniz/fnm/pull/783))

- fix test: Use correct PATH for npm install test ([#768](https://github.com/Schniz/fnm/pull/768))

- Make installation script respect `$XDG_DATA_HOME` ([#614](https://github.com/Schniz/fnm/pull/614))

## 1.31.1

### Patch Changes

- 6e6bdd8: Add changesets

#### Bugfix 🐛

- [#671](https://github.com/Schniz/fnm/pull/671) fix native-creds errors (using the unpublished version of reqwest) ([@Schniz](https://github.com/Schniz))
- [#663](https://github.com/Schniz/fnm/pull/663) remove .unwrap() and .expect() in shell code ([@Schniz](https://github.com/Schniz))
- [#656](https://github.com/Schniz/fnm/pull/656) Remove unwrap in fnm env, make error more readable ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.30.1 (2022-01-30)

#### Bugfix 🐛

- [#652](https://github.com/Schniz/fnm/pull/652) Fix `fnm completions` ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.30.0 (2022-01-30)

#### Bugfix 🐛

- [#625](https://github.com/Schniz/fnm/pull/625) Revert from using sysinfo, but only on Unix machines ([@Schniz](https://github.com/Schniz))
- [#638](https://github.com/Schniz/fnm/pull/638) Use local cache directory instead of temp directory for symlinks ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#617](https://github.com/Schniz/fnm/pull/617) fix(deps): update rust crate clap to v3 ([@renovate[bot]](https://github.com/apps/renovate))
- [#630](https://github.com/Schniz/fnm/pull/630) Replace `snafu` with `thiserror` ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#637](https://github.com/Schniz/fnm/pull/637) [Documentation] Adds Additional info regarding .node-version ([@uchihamalolan](https://github.com/uchihamalolan))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Malolan B ([@uchihamalolan](https://github.com/uchihamalolan))

## v1.29.2 (2022-01-06)

#### Bugfix 🐛

- [#626](https://github.com/Schniz/fnm/pull/626) Create the multishells directory if it is missing ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#598](https://github.com/Schniz/fnm/pull/598) Update README.md file emoji ([@lorensr](https://github.com/lorensr))
- [#616](https://github.com/Schniz/fnm/pull/616) Use on cd by default ([@matthieubosquet](https://github.com/matthieubosquet))

#### Committers: 3

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Loren ☺️ ([@lorensr](https://github.com/lorensr))
- Matthieu Bosquet ([@matthieubosquet](https://github.com/matthieubosquet))

## v1.29.1 (2021-12-28)

#### Bugfix 🐛

- [#613](https://github.com/Schniz/fnm/pull/613) Don't warn on `~/.fnm` yet ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.29.0 (2021-12-28)

#### New Feature 🎉

- [#607](https://github.com/Schniz/fnm/pull/607) Allow recursive version lookups ([@Schniz](https://github.com/Schniz))
- [#416](https://github.com/Schniz/fnm/pull/416) Respect \$XDG_DATA_HOME ([@samhh](https://github.com/samhh))

#### Bugfix 🐛

- [#603](https://github.com/Schniz/fnm/pull/603) (re)Include feature for (native) certificates ([@pfiaux](https://github.com/pfiaux))
- [#605](https://github.com/Schniz/fnm/pull/605) Add a user-agent header ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#606](https://github.com/Schniz/fnm/pull/606) Migrate to Rust 2021 edition ([@Schniz](https://github.com/Schniz))

#### Committers: 3

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Patrick Fiaux ([@pfiaux](https://github.com/pfiaux))
- Sam A. Horvath-Hunt ([@samhh](https://github.com/samhh))

## v1.28.2 (2021-12-05)

#### Bugfix 🐛

- [#586](https://github.com/Schniz/fnm/pull/586) Revert the change to ureq ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#584](https://github.com/Schniz/fnm/pull/584) Add warning to symlink creation ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.28.1 (2021-11-17)

#### Bugfix 🐛

- [#576](https://github.com/Schniz/fnm/pull/576) First fix for slowess in fnm env ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.28.0 (2021-11-16)

#### New Feature 🎉

- [#556](https://github.com/Schniz/fnm/pull/556) Allow aliasing to the system version ([@Schniz](https://github.com/Schniz))
- [#547](https://github.com/Schniz/fnm/pull/547) Replace reqwest with ureq for less dependencies and smaller file size ([@dnaka91](https://github.com/dnaka91))

#### Bugfix 🐛

- [#573](https://github.com/Schniz/fnm/pull/573) Infer shell with `sysinfo` crate ([@Schniz](https://github.com/Schniz))
- [#553](https://github.com/Schniz/fnm/pull/553) Fix Windows CMD `cd` failure on paths with spaces (`use-on-cd`) ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#554](https://github.com/Schniz/fnm/pull/554) Fix clippy & use musl target on Rust compiler for static compilation ([@dnaka91](https://github.com/dnaka91))

#### Documentation 📝

- [#545](https://github.com/Schniz/fnm/pull/545) docs(cli): Fix typo ([@SanchithHegde](https://github.com/SanchithHegde))
- [#544](https://github.com/Schniz/fnm/pull/544) Replace error message with a more useful one ([@yonifra](https://github.com/yonifra))
- [#537](https://github.com/Schniz/fnm/pull/537) Show log level options in help and error message ([@lucasweng](https://github.com/lucasweng))

#### Committers: 5

- Dominik Nakamura ([@dnaka91](https://github.com/dnaka91))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Jonathan Fraimorice ([@yonifra](https://github.com/yonifra))
- Lucas Weng ([@lucasweng](https://github.com/lucasweng))
- Sanchith Hegde ([@SanchithHegde](https://github.com/SanchithHegde))

## v1.27.0 (2021-09-17)

#### New Feature 🎉

- [#519](https://github.com/Schniz/fnm/pull/519) Windows: Use junctions rather than symlinks ([@davidaurelio](https://github.com/davidaurelio))
- [#489](https://github.com/Schniz/fnm/pull/489) Add unalias command ([@AlexMunoz](https://github.com/AlexMunoz))

#### Bugfix 🐛

- [#528](https://github.com/Schniz/fnm/pull/528) installation script: Use `=` instead of `==` ([@develoot](https://github.com/develoot))
- [#512](https://github.com/Schniz/fnm/pull/512) fix(dep): Revert "Include feature for (native) certificates #468" ([@itotallyrock](https://github.com/itotallyrock))
- [#514](https://github.com/Schniz/fnm/pull/514) Invoke fnm use on startup for PowerShell ([@naoey](https://github.com/naoey))

#### Documentation 📝

- [#529](https://github.com/Schniz/fnm/pull/529) Add Chocolatey installation instructions ([@CMeeg](https://github.com/CMeeg))
- [#496](https://github.com/Schniz/fnm/pull/496) install.sh: print an exit message for missing deps ([@waldyrious](https://github.com/waldyrious))
- [#516](https://github.com/Schniz/fnm/pull/516) More informative log level error message ([@waldyrious](https://github.com/waldyrious))
- [#493](https://github.com/Schniz/fnm/pull/493) Add instructions to setup the file for Cmder ([@Lunchb0ne](https://github.com/Lunchb0ne))

#### Committers: 8

- Abhishek Aryan ([@Lunchb0ne](https://github.com/Lunchb0ne))
- Alex Munoz ([@AlexMunoz](https://github.com/AlexMunoz))
- Chris Meagher ([@CMeeg](https://github.com/CMeeg))
- David Aurelio ([@davidaurelio](https://github.com/davidaurelio))
- Jeffrey Meyer ([@itotallyrock](https://github.com/itotallyrock))
- Kitae Kim ([@develoot](https://github.com/develoot))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))
- [@naoey](https://github.com/naoey)

## v1.26.0 (2021-07-15)

#### Bugfix 🐛

- [#484](https://github.com/Schniz/fnm/pull/484) fix: --install-if-missing when using version alias ([@AlexMunoz](https://github.com/AlexMunoz))
- [#468](https://github.com/Schniz/fnm/pull/468) Include feature for (native) certificates ([@pfiaux](https://github.com/pfiaux))

#### Documentation 📝

- [#467](https://github.com/Schniz/fnm/pull/467) Add instructions for removing fnm ([@binyamin](https://github.com/binyamin))
- [#461](https://github.com/Schniz/fnm/pull/461) Fix missing list-remote in command doc ([@binhonglee](https://github.com/binhonglee))

#### Committers: 4

- Alex Munoz ([@AlexMunoz](https://github.com/AlexMunoz))
- BinHong Lee ([@binhonglee](https://github.com/binhonglee))
- Binyamin Aron Green ([@binyamin](https://github.com/binyamin))
- Patrick Fiaux ([@pfiaux](https://github.com/pfiaux))

## v1.25.0 (2021-05-17)

#### New Feature 🎉

- [#436](https://github.com/Schniz/fnm/pull/436) feat: use arm for aarch64-darwin-node@16 platforms ([@pckilgore](https://github.com/pckilgore))

#### Documentation 📝

- [#432](https://github.com/Schniz/fnm/pull/432) Auto-generate command documentation markdown ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Patrick Kilgore ([@pckilgore](https://github.com/pckilgore))

## v1.24.0 (2021-04-02)

#### New Feature 🎉

- [#421](https://github.com/Schniz/fnm/pull/421) Adding FNM_ARCH as an exported env var from `fnm env` ([@Schniz](https://github.com/Schniz))
- [#417](https://github.com/Schniz/fnm/pull/417) Support Apple M1 by installing Rosetta Node builds ([@pckilgore](https://github.com/pckilgore))

#### Bugfix 🐛

- [#422](https://github.com/Schniz/fnm/pull/422) Create version symlinks in a nested directory ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Patrick Kilgore ([@pckilgore](https://github.com/pckilgore))

## v1.23.2 (2021-03-24)

#### Bugfix 🐛

- [#413](https://github.com/Schniz/fnm/pull/413) Improve "version not found" error message ([@waldyrious](https://github.com/waldyrious))
- [#414](https://github.com/Schniz/fnm/pull/414) More meaningful error message when a subprocess is killed ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))

## v1.23.1 (2021-03-21)

#### Bugfix 🐛

- [#411](https://github.com/Schniz/fnm/pull/411) Call the fnm use-on-cd hook on fish initialization ([@Schniz](https://github.com/Schniz))
- [#404](https://github.com/Schniz/fnm/pull/404) Ignore LogLevel on `fnm ls` ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#408](https://github.com/Schniz/fnm/pull/408) Fix ARM builds CI ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#405](https://github.com/Schniz/fnm/pull/405) Fix a couple typos ([@waldyrious](https://github.com/waldyrious))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))

## v1.23.0 (2021-03-02)

#### New Feature 🎉

- [#403](https://github.com/Schniz/fnm/pull/403) Allow `fnm use` to use a file path ([@Schniz](https://github.com/Schniz))
- [#401](https://github.com/Schniz/fnm/pull/401) Allow using filenames in --using= ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#398](https://github.com/Schniz/fnm/pull/398) `fnm exec`: Don't require double-dash ([@Schniz](https://github.com/Schniz))
- [#389](https://github.com/Schniz/fnm/pull/389) Chore - Use a tier 1 target for Linux binary ([@kaioduarte](https://github.com/kaioduarte))
- [#384](https://github.com/Schniz/fnm/pull/384) Do not list hidden directories as installed versions ([@scadu](https://github.com/scadu))

#### Documentation 📝

- [#397](https://github.com/Schniz/fnm/pull/397) Fix minor typos ([@leafrogers](https://github.com/leafrogers))
- [#385](https://github.com/Schniz/fnm/pull/385) README: add symlink support on Windows ([@scadu](https://github.com/scadu))
- [#377](https://github.com/Schniz/fnm/pull/377) Improvements to the README ([@waldyrious](https://github.com/waldyrious))

#### Committers: 5

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Kaio Duarte ([@kaioduarte](https://github.com/kaioduarte))
- Leaf Rogers ([@leafrogers](https://github.com/leafrogers))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))
- Łukasz Jendrysik ([@scadu](https://github.com/scadu))

## v1.22.9 (2021-01-22)

#### Bugfix 🐛

- [#368](https://github.com/Schniz/fnm/pull/368) Update 'ring' to '0.16.17' ([@gucheen](https://github.com/gucheen))
- [#347](https://github.com/Schniz/fnm/pull/347) Check if \$ZDOTDIR exists to find correct path to .zshrc ([@thales-maciel](https://github.com/thales-maciel))

#### Documentation 📝

- [#341](https://github.com/Schniz/fnm/pull/341) Update installation instructions ([@Schniz](https://github.com/Schniz))
- [#329](https://github.com/Schniz/fnm/pull/329) Add scoop support ([@Armaldio](https://github.com/Armaldio))
- [#334](https://github.com/Schniz/fnm/pull/334) Add installation instructions from cargo ([@zhmushan](https://github.com/zhmushan))

#### Committers: 5

- Cheng Gu ([@gucheen](https://github.com/gucheen))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Quentin Goinaud ([@Armaldio](https://github.com/Armaldio))
- Thales Maciel ([@thales-maciel](https://github.com/thales-maciel))
- 木杉 ([@zhmushan](https://github.com/zhmushan))

## v1.22.8 (2020-11-10)

#### Documentation 📝

- [#327](https://github.com/Schniz/fnm/pull/327) Make ls and ls-remote aliases visible ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.22.7 (2020-11-09)

#### New Feature 🎉

- [#315](https://github.com/Schniz/fnm/pull/315) Add `list` alias for `ls` ([@probablykasper](https://github.com/probablykasper))

#### Bugfix 🐛

- [#326](https://github.com/Schniz/fnm/pull/326) Make config arguments globally available on all commands ([@Schniz](https://github.com/Schniz))
- [#323](https://github.com/Schniz/fnm/pull/323) Escape `cd` calls in Bash's use-on-cd ([@Schniz](https://github.com/Schniz))
- [#322](https://github.com/Schniz/fnm/pull/322) Run `fnm use` on shell initialization in Bash ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Kasper ([@probablykasper](https://github.com/probablykasper))

## v1.22.6 (2020-11-04)

#### Bugfix 🐛

- [#317](https://github.com/Schniz/fnm/pull/317) Bring back --using-file flag with a deprecation warning. ([@bjornua](https://github.com/bjornua))

#### Committers: 1

- Bjørn Arnholtz ([@bjornua](https://github.com/bjornua))

## v1.22.5 (2020-10-29)

#### Bugfix 🐛

- [#310](https://github.com/Schniz/fnm/pull/310) Better error handling in symlink replacement ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#307](https://github.com/Schniz/fnm/pull/307) Refer to homebrew/core formula instead of custom tap ([@jameschensmith](https://github.com/jameschensmith))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- James Chen-Smith ([@jameschensmith](https://github.com/jameschensmith))

## v1.22.4 (2020-10-28)

#### New Feature 🎉

- [#304](https://github.com/Schniz/fnm/pull/304) Make the first installed version the default one ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#308](https://github.com/Schniz/fnm/pull/308) Allow unsuccessful symlink deletion in `fnm use` ([@Schniz](https://github.com/Schniz))
- [#303](https://github.com/Schniz/fnm/pull/303) Add ARM handling to installation script ([@Schniz](https://github.com/Schniz))
- [#289](https://github.com/Schniz/fnm/pull/289) Remove logs from automatic version switching in `--use-on-cd` ([@maxjacobson](https://github.com/maxjacobson))
- [#301](https://github.com/Schniz/fnm/pull/301) UserVersion: Fix different parsing for leading `v` ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#306](https://github.com/Schniz/fnm/pull/306) Throw an error instead of panicking when can't infer shell ([@Schniz](https://github.com/Schniz))
- [#297](https://github.com/Schniz/fnm/pull/297) Update CI badge ([@jameschensmith](https://github.com/jameschensmith))

#### Committers: 3

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- James Chen-Smith ([@jameschensmith](https://github.com/jameschensmith))
- Max Jacobson ([@maxjacobson](https://github.com/maxjacobson))

## v1.22.3 (2020-10-26)

#### New Feature 🎉

- [#292](https://github.com/Schniz/fnm/pull/292) Add uninstall command ([@Schniz](https://github.com/Schniz))
- [#276](https://github.com/Schniz/fnm/pull/276) Add pre-built binaries for ARM32 and ARM64 ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#290](https://github.com/Schniz/fnm/pull/290) Fix shell inference in VSCode ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#287](https://github.com/Schniz/fnm/pull/287) Remove `--multi` from install script ([@jameschensmith](https://github.com/jameschensmith))

#### Documentation 📝

- [#295](https://github.com/Schniz/fnm/pull/295) Add a warning if MULTISHELL env var is not in PATH ([@Schniz](https://github.com/Schniz))
- [#293](https://github.com/Schniz/fnm/pull/293) Add detailed error instead of panic regarding `fnm env` ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- James Chen-Smith ([@jameschensmith](https://github.com/jameschensmith))

## v1.22.2 (2020-10-25)

#### Bugfix 🐛

- [#284](https://github.com/Schniz/fnm/pull/284) Fix npm not working because of wrong file copying ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#282](https://github.com/Schniz/fnm/pull/282) site: proxy the installation script ([@Schniz](https://github.com/Schniz))
- [#271](https://github.com/Schniz/fnm/pull/271) Update README for Windows instructions ([@Schniz](https://github.com/Schniz))
- [#281](https://github.com/Schniz/fnm/pull/281) docs: removed mentions of --multi from README ([@folke](https://github.com/folke))

#### Committers: 2

- Folke Lemaitre ([@folke](https://github.com/folke))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.22.1 (2020-10-25)

#### Internal 🛠

- [#279](https://github.com/Schniz/fnm/pull/279) Remove UPX binary compression for now ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.22.0 (2020-10-25)

#### Bugfix 🐛

- [#275](https://github.com/Schniz/fnm/pull/275) Fix moving a node installation across mounting points ([@jaythomas](https://github.com/jaythomas))

#### Internal 🛠

- [#274](https://github.com/Schniz/fnm/pull/274) Add ARM arch support in downloads ([@jaythomas](https://github.com/jaythomas))
- [#266](https://github.com/Schniz/fnm/pull/266) Use separate config file for fish config ([@wesbaker](https://github.com/wesbaker))

#### Committers: 3

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Jay Thomas ([@jaythomas](https://github.com/jaythomas))
- Wes Baker ([@wesbaker](https://github.com/wesbaker))

## v1.22.0-beta-1 (2020-10-07)

#### New Feature 🎉

- [#244](https://github.com/Schniz/fnm/pull/244) Allow using homebrew to install with the installation script ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#225](https://github.com/Schniz/fnm/pull/225) Remove unused condition ([@joliss](https://github.com/joliss))

#### Internal 🛠

- [#246](https://github.com/Schniz/fnm/pull/246) Rewrite fnm in Rust (merge fnm.rs into fnm) — adding Windows support! ([@Schniz](https://github.com/Schniz))
- [#243](https://github.com/Schniz/fnm/pull/243) Add installation script testing ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#247](https://github.com/Schniz/fnm/pull/247) fixed a typo ([@0xflotus](https://github.com/0xflotus))
- [#245](https://github.com/Schniz/fnm/pull/245) Shorten the installation script ([@Schniz](https://github.com/Schniz))
- [#237](https://github.com/Schniz/fnm/pull/237) docs: add explanation of uninstall command to README ([@kazushisan](https://github.com/kazushisan))
- [#235](https://github.com/Schniz/fnm/pull/235) Mention fnm omf plugin for Fish users ([@idkjs](https://github.com/idkjs))

#### Committers: 5

- 0xflotus ([@0xflotus](https://github.com/0xflotus))
- Alain Armand ([@idkjs](https://github.com/idkjs))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Jo Liss ([@joliss](https://github.com/joliss))
- Kazushi Konosu ([@kazushisan](https://github.com/kazushisan))

## v1.21.0 (2020-06-07)

#### New Feature 🎉

- [#220](https://github.com/Schniz/fnm/pull/220) Add `current` command to retrieve the current Node version ([@vladimyr](https://github.com/vladimyr))
- [#210](https://github.com/Schniz/fnm/pull/210) Allow aliasing and removing an alias ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#217](https://github.com/Schniz/fnm/pull/217) Set version on new shell initialization in fish ([@jaredramirez](https://github.com/jaredramirez))
- [#207](https://github.com/Schniz/fnm/pull/207) Format dotfiles versions before comparison ([@amitdahan](https://github.com/amitdahan))

#### Committers: 4

- Amit Dahan ([@amitdahan](https://github.com/amitdahan))
- Dario Vladović ([@vladimyr](https://github.com/vladimyr))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Jared Ramirez ([@jaredramirez](https://github.com/jaredramirez))

## v1.20.0 (2020-03-22)

#### New Feature 🎉

- [#201](https://github.com/Schniz/fnm/pull/201) Create alias from version range (Closes [#185](https://github.com/Schniz/fnm/issues/185)) ([@tatchi](https://github.com/tatchi))

#### Bugfix 🐛

- [#199](https://github.com/Schniz/fnm/pull/199) Fix typo criterias -> criteria ([@waldyrious](https://github.com/waldyrious))

#### Documentation 📝

- [#204](https://github.com/Schniz/fnm/pull/204) Improve eval expression in `README.md` ([@loliee](https://github.com/loliee))

#### Committers: 3

- Corentin Leruth ([@tatchi](https://github.com/tatchi))
- Maxime Loliée ([@loliee](https://github.com/loliee))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))

## v1.19.0 (2020-03-09)

#### New Feature 🎉

- [#194](https://github.com/Schniz/fnm/pull/194) Add `fnm exec` to run commands with the fnm environment ([@Schniz](https://github.com/Schniz))
- [#191](https://github.com/Schniz/fnm/pull/191) uninstall allow prefix (Closes [#121](https://github.com/Schniz/fnm/issues/121)) ([@tatchi](https://github.com/tatchi))
- [#190](https://github.com/Schniz/fnm/pull/190) Add majorVersion option to ls-remote ([@tatchi](https://github.com/tatchi))

#### Bugfix 🐛

- [#200](https://github.com/Schniz/fnm/pull/200) Do not repeat installation prompt for unrecognized versions ([@tatchi](https://github.com/tatchi))
- [#197](https://github.com/Schniz/fnm/pull/197) Fix capitalization of message in Use.re ([@waldyrious](https://github.com/waldyrious))

#### Internal 🛠

- [#202](https://github.com/Schniz/fnm/pull/202) Update rely ([@tatchi](https://github.com/tatchi))
- [#192](https://github.com/Schniz/fnm/pull/192) Bump ocaml to 4.08 ([@tatchi](https://github.com/tatchi))

#### Committers: 3

- Corentin Leruth ([@tatchi](https://github.com/tatchi))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Waldir Pimenta ([@waldyrious](https://github.com/waldyrious))

## v1.18.1 (2019-12-30)

#### Bugfix 🐛

- [#182](https://github.com/Schniz/fnm/pull/182) Closes [#181](https://github.com/Schniz/fnm/issues/181) by dropping `exit(1)` ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.18.0 (2019-12-23)

#### New Feature 🎉

- [#176](https://github.com/Schniz/fnm/pull/176) Specify the release to the install script ([@chrisdaley](https://github.com/chrisdaley))

#### Bugfix 🐛

- [#177](https://github.com/Schniz/fnm/pull/177) Fix "illegal instruction" errors on some CPUs ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#179](https://github.com/Schniz/fnm/pull/179) Bump lwt version ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Chris Daley ([@chrisdaley](https://github.com/chrisdaley))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.17.0 (2019-11-26)

#### Bugfix 🐛

- [#169](https://github.com/Schniz/fnm/pull/169) Support spaces in directory name in Bash ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#172](https://github.com/Schniz/fnm/pull/172) Revert into using `ocaml-tls` instead of `ocaml-ssl` ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.16.0 (2019-10-27)

#### New Feature 🎉

- [#146](https://github.com/Schniz/fnm/pull/146) Add support for `lts/*` ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#150](https://github.com/Schniz/fnm/pull/150) Add missing log level to `env` output for Fish shell ([@thomsj](https://github.com/thomsj))

#### Internal 🛠

- [#154](https://github.com/Schniz/fnm/pull/154) Run all feature tests ([@Schniz](https://github.com/Schniz))
- [#148](https://github.com/Schniz/fnm/pull/148) Make `env` smoke test pass when run with fish ([@thomsj](https://github.com/thomsj))
- [#153](https://github.com/Schniz/fnm/pull/153) Add missing `exit 1`s to `partial_semver` tests ([@thomsj](https://github.com/thomsj))
- [#151](https://github.com/Schniz/fnm/pull/151) Add a CI check for code formatting ([@Schniz](https://github.com/Schniz))
- [#149](https://github.com/Schniz/fnm/pull/149) Update to v6.17.1 in `partial_semver` feature test ([@thomsj](https://github.com/thomsj))
- [#143](https://github.com/Schniz/fnm/pull/143) Try to install new deps ([@Schniz](https://github.com/Schniz))
- [#142](https://github.com/Schniz/fnm/pull/142) Drop buildsInSource ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#157](https://github.com/Schniz/fnm/pull/157) Rename `--base-dir` to `--fnm-dir` in README ([@thomsj](https://github.com/thomsj))
- [#158](https://github.com/Schniz/fnm/pull/158) Uncapitalise "Node" in `--multi` description ([@thomsj](https://github.com/thomsj))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- James Thomson ([@thomsj](https://github.com/thomsj))

## v1.15.0 (2019-09-23)

#### Bugfix 🐛

- [#138](https://github.com/Schniz/fnm/pull/138) Do uninstallation in steps ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#132](https://github.com/Schniz/fnm/pull/132) Fix spelling of availability in install.sh ([@trevershick](https://github.com/trevershick))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Trever Shick ([@trevershick](https://github.com/trevershick))

## v1.14.0 (2019-08-20)

#### New Feature 🎉

- [#134](https://github.com/Schniz/fnm/pull/134) Alias -v to --version ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#131](https://github.com/Schniz/fnm/pull/131) Deprecates MacOS installation using the script in favor of Homebrew ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#133](https://github.com/Schniz/fnm/pull/133) Fix Windows build once again! ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.13.0 (2019-07-15)

#### New Feature 🎉

- [#129](https://github.com/Schniz/fnm/pull/129) Alias latest versions on installation ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#125](https://github.com/Schniz/fnm/pull/125) format versions in `uninstall` ([@Schniz](https://github.com/Schniz))
- [#114](https://github.com/Schniz/fnm/pull/114) installation script: use $INSTALL_DIR instead of hard-coded $HOME/.fnm ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#130](https://github.com/Schniz/fnm/pull/130) Fix issues related to help pages ([@Schniz](https://github.com/Schniz))
- [#123](https://github.com/Schniz/fnm/pull/123) Fix typo in successfully ([@pavelloz](https://github.com/pavelloz))
- [#118](https://github.com/Schniz/fnm/pull/118) Add note about upgrading ([@pavelloz](https://github.com/pavelloz))
- [#119](https://github.com/Schniz/fnm/pull/119) Remove "Homebrew" from future plans as it is done ([@pavelloz](https://github.com/pavelloz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Paweł Kowalski ([@pavelloz](https://github.com/pavelloz))

## v1.12.0 (2019-06-06)

#### New Feature 🎉

- [#106](https://github.com/Schniz/fnm/pull/106) Add `default`, as a shortcut for `alias default` ([@dangdennis](https://github.com/dangdennis))
- [#104](https://github.com/Schniz/fnm/pull/104) Add a 'debug' log level ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#88](https://github.com/Schniz/fnm/pull/88) Successfully build on Windows ([@ulrikstrid](https://github.com/ulrikstrid))

#### Committers: 3

- Dennis Dang ([@dangdennis](https://github.com/dangdennis))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Ulrik Strid ([@ulrikstrid](https://github.com/ulrikstrid))

## v1.11.0 (2019-05-27)

#### New Feature 🎉

- [#98](https://github.com/Schniz/fnm/pull/98) Add `uninstall` command ([@tatchi](https://github.com/tatchi))
- [#97](https://github.com/Schniz/fnm/pull/97) Add the ability to use system version of Node ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#103](https://github.com/Schniz/fnm/pull/103) Fix missing aliases due to newer `realpath` ([@Schniz](https://github.com/Schniz))
- [#99](https://github.com/Schniz/fnm/pull/99) fix EACCES error when installing an already downloaded version ([@tatchi](https://github.com/tatchi))

#### Internal 🛠

- [#101](https://github.com/Schniz/fnm/pull/101) Move from base to core ([@ulrikstrid](https://github.com/ulrikstrid))
- [#102](https://github.com/Schniz/fnm/pull/102) Implement `realpath` instead of binding to C library ([@Schniz](https://github.com/Schniz))
- [#100](https://github.com/Schniz/fnm/pull/100) Add Semver to library, an simple non-spec implementation of semver ([@Schniz](https://github.com/Schniz))

#### Committers: 3

- Corentin Leruth ([@tatchi](https://github.com/tatchi))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Ulrik Strid ([@ulrikstrid](https://github.com/ulrikstrid))

## v1.10.0 (2019-05-01)

#### New Feature 🎉

- [#93](https://github.com/Schniz/fnm/pull/93) Add support for log level (Closes [#33](https://github.com/Schniz/fnm/issues/33)) ([@ohana54](https://github.com/ohana54))

#### Documentation 📝

- [#95](https://github.com/Schniz/fnm/pull/95) Shorten installation script url ([@vladimyr](https://github.com/vladimyr))

#### Committers: 2

- Dario Vladović ([@vladimyr](https://github.com/vladimyr))
- Tomer Ohana ([@ohana54](https://github.com/ohana54))

## v1.9.1 (2019-04-14)

#### Bugfix 🐛

- [#91](https://github.com/Schniz/fnm/pull/91) Fix `fnm env` for fish shell. ([@hwartig](https://github.com/hwartig))
- [#90](https://github.com/Schniz/fnm/pull/90) Installation script doesn't use GitHub API, but a link to the latest directly ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Harald Wartig ([@hwartig](https://github.com/hwartig))

## v1.9.0 (2019-03-18)

#### New Feature 🎉

- [#86](https://github.com/Schniz/fnm/pull/86) Add support for interactive installation for use ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#85](https://github.com/Schniz/fnm/pull/85) Update README.md ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.8.0 (2019-03-13)

#### Bugfix 🐛

- [#83](https://github.com/Schniz/fnm/pull/83) fix: remove unmatched quote written in the fish config file ([@thomasmarcel](https://github.com/thomasmarcel))

#### Internal 🛠

- [#84](https://github.com/Schniz/fnm/pull/84) Strip binaries to make them smaller ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Thomas Alcala Schneider ([@thomasmarcel](https://github.com/thomasmarcel))

## v1.7.2 (2019-03-07)

#### Bugfix 🐛

- [#79](https://github.com/Schniz/fnm/pull/79) Guard from more non-existent directories errors ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.7.1 (2019-03-05)

#### Bugfix 🐛

- [#77](https://github.com/Schniz/fnm/pull/77) Fix "command not found: elsif" error ([@jletey](https://github.com/jletey))

#### Internal 🛠

- [#78](https://github.com/Schniz/fnm/pull/78) Add a test to `use-on-cd` when `.node-version` is found ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- John Letey ([@jletey](https://github.com/jletey))

## v1.7.0 (2019-03-04)

#### New Feature 🎉

- [#68](https://github.com/Schniz/fnm/pull/68) Infer shells automatically, and `use` versions based on the current working directory (optional) ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.6.2 (2019-03-04)

#### Bugfix 🐛

- [#72](https://github.com/Schniz/fnm/pull/72) Fix alias paths ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#70](https://github.com/Schniz/fnm/pull/70) Fix installation script parameters docs ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.6.1 (2019-02-26)

#### Bugfix 🐛

- [#69](https://github.com/Schniz/fnm/pull/69) Fix version inference by throwing on http 404 again ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.6.0 (2019-02-25)

#### New Feature 🎉

- [#57](https://github.com/Schniz/fnm/pull/57) Switch to cohttp(lwt) instead of curl ([@tatchi](https://github.com/tatchi))

#### Bugfix 🐛

- [#64](https://github.com/Schniz/fnm/pull/64) Throw on errors in installation script ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#67](https://github.com/Schniz/fnm/pull/67) Use `perl-utils` instead of custom written `shasum` ([@Schniz](https://github.com/Schniz))
- [#66](https://github.com/Schniz/fnm/pull/66) Use newer esy ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Corentin Leruth ([@tatchi](https://github.com/tatchi))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.5.1 (2019-02-22)

#### Bugfix 🐛

- [#61](https://github.com/Schniz/fnm/pull/61) Fix a bug where `fnm env --multi` didn't used the default alias ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.5.0 (2019-02-21)

#### New Feature 🎉

- [#60](https://github.com/Schniz/fnm/pull/60) Disable colors for non-tty devices ([@Schniz](https://github.com/Schniz))
- [#48](https://github.com/Schniz/fnm/pull/48) Add parameters to the install script, enabling custom installs (`--install-dir` and `--skip-shell`) ([@from-nibly](https://github.com/from-nibly))
- [#54](https://github.com/Schniz/fnm/pull/54) Infer complete semver (`vX.X.X`) out of partial input (`vX`/`vX.X`). ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#58](https://github.com/Schniz/fnm/pull/58) Adding check for OSX during writing for bash shell ([@maxknee](https://github.com/maxknee))
- [#56](https://github.com/Schniz/fnm/pull/56) Correct status code on `install` failures ([@ranyitz](https://github.com/ranyitz))

#### Internal 🛠

- [#55](https://github.com/Schniz/fnm/pull/55) Make tests faster by using cnpmjs as Node.js mirror in tests ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#49](https://github.com/Schniz/fnm/pull/49) Add a `--fnm-dir` option to `fnm env` ([@Schniz](https://github.com/Schniz))
- [#50](https://github.com/Schniz/fnm/pull/50) Added CHANGELOG ([@Schniz](https://github.com/Schniz))

#### Committers: 4

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- Jordan Davidson ([@from-nibly](https://github.com/from-nibly))
- Max Knee ([@maxknee](https://github.com/maxknee))
- Ran Yitzhaki ([@ranyitz](https://github.com/ranyitz))

## v1.4.0 (2019-02-18)

#### New Feature 🎉

- [#45](https://github.com/Schniz/fnm/pull/45) Use exit code 1 on errors on `fnm use` ([@Schniz](https://github.com/Schniz))
- [#42](https://github.com/Schniz/fnm/pull/42) Add support for .node-version files ([@Dean177](https://github.com/Dean177))

#### Documentation 📝

- [#44](https://github.com/Schniz/fnm/pull/44) Quick fix for the dev environment setup ([@AdamGS](https://github.com/AdamGS))

#### Committers: 3

- Adam Gutglick ([@AdamGS](https://github.com/AdamGS))
- Dean Merchant ([@Dean177](https://github.com/Dean177))
- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.3.0 (2019-02-14)

#### New Feature 🎉

- [#36](https://github.com/Schniz/fnm/pull/36) Support Node.js mirrors ([@Schniz](https://github.com/Schniz))
- [#30](https://github.com/Schniz/fnm/pull/30) Aliases and multishell support ([@Schniz](https://github.com/Schniz))
- [#37](https://github.com/Schniz/fnm/pull/37) Don't throw on existing installation ([@Schniz](https://github.com/Schniz))
- [#27](https://github.com/Schniz/fnm/pull/27) skip installation if the version is already installed ([@kentac55](https://github.com/kentac55))

#### Documentation 📝

- [#22](https://github.com/Schniz/fnm/pull/22) Add a LICENSE file ([@Schniz](https://github.com/Schniz))

#### Committers: 2

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))
- [@kentac55](https://github.com/kentac55)

## v1.2.1 (2019-02-11)

#### Bugfix 🐛

- [#25](https://github.com/Schniz/fnm/pull/25) CI (fnm-linux => fnm) ([@Schniz](https://github.com/Schniz))

#### Internal 🛠

- [#21](https://github.com/Schniz/fnm/pull/21) Add feature test for Fish shell ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#23](https://github.com/Schniz/fnm/pull/23) Add installation script ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.2.0 (2019-01-30)

#### New Feature 🎉

- [#17](https://github.com/Schniz/fnm/pull/17) Use xz files instead of gz ([@Schniz](https://github.com/Schniz))

#### Bugfix 🐛

- [#16](https://github.com/Schniz/fnm/pull/16) Make `fnm --version` show the correct version ([@Schniz](https://github.com/Schniz))
- [#15](https://github.com/Schniz/fnm/pull/15) Don't throw in nonexistent directory on `fnm ls` ([@Schniz](https://github.com/Schniz))

#### Documentation 📝

- [#13](https://github.com/Schniz/fnm/pull/13) Added short docs to the README ([@Schniz](https://github.com/Schniz))

#### Committers: 1

- Gal Schlezinger ([@Schniz](https://github.com/Schniz))

## v1.1.0 (2019-01-27)

#### New Feature 🎉

- [#10](https://github.com/Schniz/fnm/pull/10) Add fish shell setup to `env` command and README ([@elliottsj](https://github.com/elliottsj))

#### Committers: 1

- Spencer Elliott ([@elliottsj](https://github.com/elliottsj))


================================================
FILE: Cargo.toml
================================================
[package]
name = "fnm"
version = "1.39.0"
authors = ["Gal Schlezinger <gal@spitfire.co.il>"]
edition = "2021"
build = "build.rs"
license = "GPL-3.0"
repository = "https://github.com/Schniz/fnm"
description = "Fast and simple Node.js version manager"

[dependencies]
serde = { version = "1.0.203", features = ["derive"] }
clap = { version = "4.5.4", features = ["derive", "env"] }
serde_json = "1.0.117"
chrono = { version = "0.4.38", features = ["serde", "now"], default-features = false }
tar = "0.4.40"
xz2 = "0.1.7"
node-semver = "2.1.0"
etcetera = "0.8.0"
colored = "2.1.0"
zip = "2.1.0"
tempfile = "3.10.1"
indoc = "2.0.5"
log = "0.4.21"
env_logger = "0.11.3"
encoding_rs_io = "0.1.7"
reqwest = { version = "0.12.4", features = ["blocking", "json", "rustls-tls", "rustls-tls-native-roots", "brotli"], default-features = false }
url = "2.5.0"
sysinfo = "0.30.12"
thiserror = "1.0.61"
clap_complete = "4.5.2"
anyhow = "1.0.86"
indicatif = { version = "0.17.8", features = ["improved_unicode"] }
flate2 = "1.0.30"
miette = { version = "7.2.0", features = ["fancy"] }

[dev-dependencies]
pretty_assertions = "1.4.0"
duct = "0.13.7"
test-log = "0.2.16"
http = "1.1.0"

[build-dependencies]
embed-resource = "2.4.2"

[target.'cfg(windows)'.dependencies]
csv = "1.3.0"
junction = "1.1.0"

[features]


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
<h1 align="center">
  Fast Node Manager (<code>fnm</code>)
  <img alt="Amount of downloads" src="https://img.shields.io/github/downloads/Schniz/fnm/total.svg?style=flat" />
  <a href="https://github.com/Schniz/fnm/actions"><img src="https://img.shields.io/github/actions/workflow/status/Schniz/fnm/rust.yml?branch=master&label=workflow" alt="GitHub Actions workflow status" /></a>
</h1>

> 🚀 Fast and simple Node.js version manager, built in Rust

<div align="center">
  <img src="./docs/fnm.svg" alt="Blazing fast!">
</div>

## Features

🌎 Cross-platform support (macOS, Windows, Linux)

✨ Single file, easy installation, instant startup

🚀 Built with speed in mind

📂 Works with `.node-version` and `.nvmrc` files

## Installation

### Using a script (macOS/Linux)

For `bash`, `zsh` and `fish` shells, there's an [automatic installation script](./.ci/install.sh).

First ensure that `curl` and `unzip` are already installed on your operating system. Then execute:

```sh
curl -fsSL https://fnm.vercel.app/install | bash
```

#### Upgrade

On macOS, it is as simple as `brew upgrade fnm`.

On other operating systems, upgrading `fnm` is almost the same as installing it. To prevent duplication in your shell config file, pass `--skip-shell` to the install command:

```sh
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
```

#### Parameters

`--install-dir`

Set a custom directory for fnm to be installed. The default is `$XDG_DATA_HOME/fnm` (if `$XDG_DATA_HOME` is not defined it falls back to `$HOME/.local/share/fnm` on linux and `$HOME/Library/Application Support/fnm` on MacOS).

> **Note:** On macOS, this option is only meaningful when using `--force-install` since Homebrew is the default installation method.

`--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/conf.d/fnm.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:

```sh
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" --skip-shell
```

### Manually

#### Using Homebrew (macOS/Linux)

```sh
brew install fnm
```

Then, [set up your shell for fnm](#shell-setup)

#### Using Winget (Windows)

```sh
winget install Schniz.fnm
```

#### Using Scoop (Windows)

```sh
scoop install fnm
```

Then, [set up your shell for fnm](#shell-setup)

#### Using Chocolatey (Windows)

```sh
choco install fnm
```

Then, [set up your shell for fnm](#shell-setup)

#### Using Cargo (Linux/macOS/Windows)

```sh
cargo install fnm
```

Then, [set up your shell for fnm](#shell-setup)

#### Using a release binary (Linux/macOS/Windows)

- Download the [latest release binary](https://github.com/Schniz/fnm/releases) for your system
- Make it available globally on `PATH` environment variable
- [Set up your shell for fnm](#shell-setup)

### Removing

To remove fnm (😢), just delete the `.fnm` folder in your home directory. You should also edit your shell configuration to remove any references to fnm (ie. read [Shell Setup](#shell-setup), and do the opposite).

## Completions

fnm ships its completions with the binary:

```sh
fnm completions --shell <SHELL>
```

Where `<SHELL>` can be one of the supported shells:

- `bash`
- `zsh`
- `fish`
- `powershell`

Please follow your shell instructions to install them.

### Shell Setup

Environment variables need to be setup before you can start using fnm.
This is done by evaluating the output of `fnm env`.

> [!TIP]
> Prefer passing an explicit shell (for example `fnm env --shell bash`) instead of relying on shell inference at runtime. It is a bit faster and avoids process tree detection.

> [!NOTE]
> Check out the [Configuration](./docs/configuration.md) section to enable highly
> recommended features, like automatic version switching.

Adding a `.node-version` to your project is as simple as:

```bash
$ node --version
v14.18.3
$ node --version > .node-version
```

Check out the following guides for the shell you use:

#### Bash

Add the following to your `.bashrc` profile:

```bash
eval "$(fnm env --use-on-cd --shell bash)"
```

#### Zsh

Add the following to your `.zshrc` profile:

```zsh
eval "$(fnm env --use-on-cd --shell zsh)"
```

#### Fish shell

Create `~/.config/fish/conf.d/fnm.fish` and add this line to it:

```fish
fnm env --use-on-cd --shell fish | source
```

#### PowerShell

Add the following to the end of your profile file:

```powershell
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
```

- For macOS/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1`
- For Windows location is either:
  - `%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1` Powershell 5
  - `%userprofile%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` Powershell 6+
- To create the profile file you can run this in PowerShell:
  ```powershell
  if (-not (Test-Path $profile)) { New-Item $profile -Force }
  ```
- To edit your profile run this in PowerShell:
  ```powershell
  Invoke-Item $profile
  ```

#### Windows Command Prompt aka Batch aka WinCMD

fnm is also supported but is not entirely covered. You can set up a startup script for [cmd.exe](https://superuser.com/a/144348) or [Windows Terminal](https://superuser.com/a/1855283) and append the following lines:

```batch
@echo off
:: for /F will launch a new instance of cmd so we create a guard to prevent an infnite loop
if not defined FNM_AUTORUN_GUARD (
    set "FNM_AUTORUN_GUARD=AutorunGuard"
    FOR /f "tokens=*" %%z IN ('fnm env --use-on-cd') DO CALL %%z
)
```

#### Usage with Cmder

Usage is very similar to the normal WinCMD install, apart for a few tweaks to allow being called from the cmder startup script. The example **assumes** that the `CMDER_ROOT` environment variable is **set** to the **root directory** of your Cmder installation.
Then you can do something like this:

- Make a .cmd file to invoke it

```batch
:: %CMDER_ROOT%\bin\fnm_init.cmd
@echo off
FOR /f "tokens=*" %%z IN ('fnm env --use-on-cd') DO CALL %%z
```

- Add it to the startup script

```batch
:: %CMDER_ROOT%\config\user_profile.cmd
call "%CMDER_ROOT%\bin\fnm_init.cmd"
```

You can replace `%CMDER_ROOT%` with any other convenient path too.

## [Configuration](./docs/configuration.md)

[See the available configuration options for an extended configuration documentation](./docs/configuration.md)

## [Usage](./docs/commands.md)

[See the available commands for an extended usage documentation](./docs/commands.md)

## Contributing

PRs welcome :tada:

### Developing:

```sh
# Install Rust
git clone https://github.com/Schniz/fnm.git
cd fnm/
cargo build
```

### Running Binary:

```sh
cargo run -- --help # Will behave like `fnm --help`
```

### Running Tests:

```sh
cargo test
```


================================================
FILE: benchmarks/basic/fnm
================================================
#!/bin/bash

eval "$(fnm env --shell=bash)"
fnm install v10.11.0
fnm use v10.11.0
node -v


================================================
FILE: benchmarks/basic/nvm
================================================
#!/bin/bash

export NVM_DIR="$HOME/.nvm"
\. "$NVM_DIR/nvm.sh"  # This loads nvm

nvm install v10.11.0
nvm use v10.11.0
node -v


================================================
FILE: benchmarks/run
================================================
#!/bin/bash

set -e

export FNM_DIR

BASE_DIR="$(dirname "$(realpath "$0")")"
cd "$BASE_DIR" || exit 1

FNM_DIR="$(mktemp -d)"
export PATH="$BASE_DIR/../target/release:$PATH"

mkdir results 2>/dev/null || :

if [ ! -f "$BASE_DIR/../target/release/fnm" ]; then
  echo "Can't access the release version of fnm.rs"
  exit 1
fi

if ! command -v hyperfine >/dev/null 2>&1; then
  echo "Can't access Hyperfine. Are you sure it is installed?"
  echo "  if not, visit https://github.com/sharkdp/hyperfine"
  exit 1
fi

# Running it with warmup means we're going to have the versions
# pre-installed. I think it is good because you open your shell more times
# than you install Node versions.
hyperfine \
  --warmup=2 \
  --min-runs=40 \
  --time-unit=millisecond \
  --export-json="./results/basic.json" \
  --export-markdown="./results/basic.md" \
  "basic/nvm" \
  "basic/fnm"


================================================
FILE: benchmarks/run.mjs
================================================
// @ts-check

import z from "zod"
import os from "node:os"
import path from "node:path"
import fetch from "node-fetch"
import { execa } from "execa"
import { binary, command, flag, option } from "cmd-ts"
import Url from "cmd-ts/dist/cjs/batteries/url.js"
import { run } from "cmd-ts"
import fs from "node:fs/promises"
import { dedent } from "ts-dedent"

const HyperfineResult = z.object({
  results: z.array(
    z.object({
      command: z.string(),
      mean: z.number(),
      stddev: z.number(),
      median: z.number(),
      user: z.number(),
      system: z.number(),
      min: z.number(),
      max: z.number(),
      times: z.array(z.number()),
      exit_codes: z.array(z.literal(0)),
    })
  ),
})

const BenchyResult = z.object({
  data: z.object({
    embed: z.object({
      small: z.string(),
      big: z.string(),

      currentValue: z.number(),
      lastValue: z.number().optional(),
      diff: z
        .object({
          value: z.number(),
          arrowImage: z.string(),
        })
        .optional(),
    }),
  }),
})

const { HttpUrl } = Url

const cmd = command({
  name: "run-benchmarks",
  args: {
    serverUrl: option({
      long: "server-url",
      type: HttpUrl,
      defaultValue: () => new URL("https://benchy.hagever.com"),
      defaultValueIsSerializable: true,
    }),
    githubToken: option({
      long: "github-token",
      env: "GITHUB_TOKEN",
    }),
    shouldStore: flag({
      long: "store",
    }),
  },
  async handler({ serverUrl, githubToken, shouldStore }) {
    const repoName = "fnm"
    const repoOwner = "schniz"

    const hyperfineResult = await runHyperfine()

    if (!hyperfineResult.success) {
      console.error(
        `Can't run benchmarks: wrong data:`,
        hyperfineResult.error.issues
      )
      process.exitCode = 1
      return
    }

    const { results } = hyperfineResult.data

    const url = new URL("/api/metrics", serverUrl)
    const trackedKeys = ["median", "max", "mean", "min", "stddev"]

    const metrics = results
      .flatMap((result) => {
        return trackedKeys.map((key) => {
          return {
            displayName: `${result.command}/${key}`,
            value: result[key] * 1000, // everything is in seconds
            units: "ms",
          }
        })
      })
      .concat([
        {
          displayName: `binary size`,
          value: await getFilesize(),
          units: "kb",
        },
      ])
      .map((metric) => {
        return {
          ...metric,
          key: `${os.platform()}/${os.arch()}/${metric.displayName}`,
        }
      })

    const embeds$ = metrics.map(async ({ key, value, displayName, units }) => {
      const response = await fetch(String(url), {
        method: "PUT",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          coloring: "lower-is-better",
          repoOwner,
          repoName,
          githubToken,
          key,
          value,
        }),
      })

      if (!response.ok) {
        throw new Error(`Response is not okay: ${response.status}`)
      }

      const { data } = BenchyResult.parse(await response.json())
      return {
        displayName,
        units,
        ...data.embed,
      }
    })

    const embeds = await Promise.all(embeds$)

    const table = (() => {
      const rows = embeds
        .map((data) => {
          return dedent`
            <tr>
              <td><code>${data.displayName}</code></td>
              <td><code>${round(data.currentValue, 2)}${data.units}</code></td>
              <td>${
                typeof data.lastValue === "undefined"
                  ? ""
                  : `<code>${round(data.lastValue, 2)}${data.units}</code>`
              }</td>
              <td>${
                !data.diff
                  ? "<code>0</code>"
                  : dedent`
                  <picture title=${JSON.stringify(
                    data.diff.value > 0 ? "increase" : "decrease"
                  )}>
                    <img width="16" valign="middle" src="${
                      data.diff.arrowImage
                    }">
                  </picture>
                  <code>${data.diff.value > 0 ? "+" : ""}${round(
                      data.diff.value,
                      2
                    )}${data.units}</code>
                    `
              }</td>
              <td>
                <details><summary><img valign="middle" src="${
                  data.small
                }" /></summary><br/><img src="${data.big}" /></details>
              </td>
            </tr>
          `
        })
        .join("\n")
      return dedent`
        <table>
          <thead>
            <tr>
              <th align="left">benchmark</th>
              <th>current value</th>
              <th>last value</th>
              <th>diff</th>
              <th>trend</th>
            </tr>
          </thead>
          <tbody>
            ${rows}
          </tbody>
        </table>
      `
    })()

    console.log(table)

    if (shouldStore) {
      const response = await fetch(String(url), {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          repoOwner,
          repoName,
          githubToken,
          metrics,
        }),
      })

      if (!response.ok) {
        throw new Error(`Response is not okay: ${response.status}`)
      }

      console.error(await response.json())
    }
  },
})

/**
 * @param {number} number
 * @param {number} digits
 */
function round(number, digits) {
  const pow = Math.pow(10, digits)
  return Math.round(number * pow) / pow
}

/**
 * Returns the size of the `fnm` binary in kilobytes
 *
 * @returns number
 */
async function getFilesize() {
  const fnmBinary = await execa("which", ["fnm"])
  const stat = await fs.stat(fnmBinary.stdout.trim())
  return Math.round(stat.size / 1024)
}

async function runHyperfine() {
  const file = path.join(os.tmpdir(), `bench-${Date.now()}.json`)
  await execa(
    `hyperfine`,
    [
      "--min-runs=20",
      `--export-json=${file}`,
      "--warmup=2",
      ...[
        "--command-name=fnm_basic",
        new URL("./basic/fnm", import.meta.url).pathname,
      ],
      // ...[
      //   "--command-name=nvm_basic",
      //   new URL("./basic/nvm", import.meta.url).pathname,
      // ],
    ],
    {
      stdout: process.stderr,
      stderr: process.stderr,
      stdin: "ignore",
    }
  )

  const json = JSON.parse(await fs.readFile(file, "utf8"))
  const parsed = HyperfineResult.safeParse(json)
  return parsed
}

run(binary(cmd), process.argv)


================================================
FILE: build.rs
================================================
fn main() {
    embed_resource::compile("fnm-manifest.rc", embed_resource::NONE);
}


================================================
FILE: docs/commands.md
================================================
# `fnm`

```
A fast and simple Node.js manager

Usage: fnm [OPTIONS] <COMMAND>

Commands:
  list-remote  List all remote Node.js versions [aliases: ls-remote]
  list         List all locally installed Node.js versions [aliases: ls]
  install      Install a new Node.js version [aliases: i]
  use          Change Node.js version
  env          Print and set up required environment variables for fnm
  completions  Print shell completions to stdout
  alias        Alias a version to a common name
  unalias      Remove an alias definition
  default      Set a version as the default version or get the current default version
  current      Print the current Node.js version
  exec         Run a command within fnm context
  uninstall    Uninstall a Node.js version [aliases: uni]
  help         Print this message or the help of the given subcommand(s)

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version
```

# `fnm list-remote`

```
List all remote Node.js versions

Usage: fnm list-remote [OPTIONS]

Options:
      --filter <FILTER>
          Filter versions by a user-defined version or a semver range

      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --lts [<LTS>]
          Show only LTS versions (optionally filter by LTS codename)

      --sort <SORT>
          Version sorting order

          [default: asc]

          Possible values:
          - desc: Sort versions in descending order (latest to earliest)
          - asc:  Sort versions in ascending order (earliest to latest)

      --latest
          Only show the latest matching version

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm list`

```
List all locally installed Node.js versions

Usage: fnm list [OPTIONS]

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm install`

```
Install a new Node.js version

Usage: fnm install [OPTIONS] [VERSION]

Arguments:
  [VERSION]
          A version string. Can be a partial semver or a LTS version name by the format lts/NAME

Options:
      --lts
          Install latest LTS

      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --latest
          Install latest version

      --progress <PROGRESS>
          Show an interactive progress bar for the download status

          [default: auto]
          [possible values: auto, never, always]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --use
          Use the installed version immediately after installation

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm use`

```
Change Node.js version

Usage: fnm use [OPTIONS] [VERSION]

Arguments:
  [VERSION]


Options:
      --install-if-missing
          Install the version if it isn't installed yet

      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --silent-if-unchanged
          Don't output a message identifying the version being used if it will not change due to execution of this command

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm env`

```
Print and set up required environment variables for fnm

This command generates a series of shell commands that should be evaluated by your shell to create a fnm-ready environment.

Each shell has its own syntax of evaluating a dynamic expression. For example, evaluating fnm on Bash and Zsh would look like `eval "$(fnm env --shell bash)"`. In Fish, evaluating would look like `fnm env --shell fish | source`

Usage: fnm env [OPTIONS]

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --shell <SHELL>
          The shell syntax to use. Infers when missing

          [possible values: bash, zsh, fish, powershell]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --json
          Print JSON instead of shell commands

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --use-on-cd
          Print the script to change Node versions every directory change

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm completions`

```
Print shell completions to stdout

Usage: fnm completions [OPTIONS]

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --shell <SHELL>
          The shell syntax to use. Infers when missing

          [possible values: bash, zsh, fish, powershell]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm alias`

```
Alias a version to a common name

Usage: fnm alias [OPTIONS] <TO_VERSION> <NAME>

Arguments:
  <TO_VERSION>


  <NAME>


Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm unalias`

```
Remove an alias definition

Usage: fnm unalias [OPTIONS] <REQUESTED_ALIAS>

Arguments:
  <REQUESTED_ALIAS>


Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm default`

```
Set a version as the default version or get the current default version.

This is a shorthand for `fnm alias VERSION default`

Usage: fnm default [OPTIONS] [VERSION]

Arguments:
  [VERSION]


Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm current`

```
Print the current Node.js version

Usage: fnm current [OPTIONS]

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm exec`

```
Run a command within fnm context

Example:
--------
fnm exec --using=v12.0.0 node --version
=> v12.0.0

Usage: fnm exec [OPTIONS] [ARGUMENTS]...

Arguments:
  [ARGUMENTS]...
          The command to run

Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --using <VERSION>
          Either an explicit version, or a filename with the version written in it

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm uninstall`

```
Uninstall a Node.js version

> Warning: when providing an alias, it will remove the Node version the alias > is pointing to, along with the other aliases that point to the same version.

Usage: fnm uninstall [OPTIONS] [VERSION]

Arguments:
  [VERSION]


Options:
      --node-dist-mirror <NODE_DIST_MIRROR>
          <https://nodejs.org/dist/> mirror

          [env: FNM_NODE_DIST_MIRROR]
          [default: https://nodejs.org/dist]

      --fnm-dir <BASE_DIR>
          The root directory of fnm installations

          [env: FNM_DIR]

      --log-level <LOG_LEVEL>
          The log level of fnm commands

          [env: FNM_LOGLEVEL]
          [default: info]
          [possible values: quiet, error, info]

      --arch <ARCH>
          Override the architecture of the installed Node binary. Defaults to arch of fnm binary

          [env: FNM_ARCH]

      --version-file-strategy <VERSION_FILE_STRATEGY>
          A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation

          [env: FNM_VERSION_FILE_STRATEGY]
          [default: local]

          Possible values:
          - local:     Use the local version of Node defined within the current directory
          - recursive: Use the version of Node defined within the current directory and all parent directories

      --corepack-enabled
          Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see <https://nodejs.org/api/corepack.html>

          [env: FNM_COREPACK_ENABLED]

      --resolve-engines [<RESOLVE_ENGINES>]
          Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present.
          This feature is enabled by default. To disable it, provide `--resolve-engines=false`.

          Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.
          Note 2: If you disable it, please open an issue on GitHub describing _why_ you disabled it.
                  In the future, disabling it might be a no-op, so it's worth knowing any reason to
                  do that.

          [env: FNM_RESOLVE_ENGINES]
          [possible values: true, false]

  -h, --help
          Print help (see a summary with '-h')
```

# `fnm help`

```

```


================================================
FILE: docs/configuration.md
================================================
# Configuration

fnm comes with many features out of the box. Some of them are not activated by default as they’re changing your shell default behavior, and some are just a feature flag to avoid breaking changes or just experimental until we decide it is worthwhile to introduce them.

All these features can be configured by adding flags to the `fnm env` call when initializing the shell. For instance, if your shell set up looks like `eval "$(fnm env)"` then you can add a flag to it by changing it to `eval "$(fnm env --my-flag=value)"`

Here’s a list of these features and capabilities:

### `--use-on-cd`

**✅ Highly recommended**

`--use-on-cd` appends output to `fnm env`'s output that will hook into your shell upon changing directories, and will switch the Node.js version based on the requirements of the current directory, based on `.node-version` or `.nvmrc` (or `packages.json#engines#node` if `--resolve-engines` was enabled).

This allows you do avoid thinking about `fnm use`, and only `cd <DIR>` to make it work.

### `--version-file-strategy=recursive`

**✅ Highly recommended**

Makes `fnm use` and `fnm install` take parent directories into account when looking for a version file ("dotfile")--when no argument was given.

So, let's say we have the following directory structure:

```
repo/
├── package.json
├── .node-version <- with content: `20.0.0`
└── packages/
  └── my-package/ <- I am here
    └── package.json
```

And I'm running the following command:

```sh-session
repo/packages/my-package$ fnm use
```

Then fnm will switch to Node.js v20.0.0.

Without the explicit flag, the value is set to `local`, which will not traverse the directory tree and therefore will print:

```sh-session
repo/packages/my-package$ fnm use
error: Can't find version in dotfiles. Please provide a version manually to the command.
```

### `--corepack-enabled`

**🧪 Experimental**

Runs [`corepack enable`](https://nodejs.org/api/corepack.html#enabling-the-feature) when a new version of Node.js is installed. Experimental due to the fact Corepack itself is experimental.

### `--resolve-engines`

**🧪 Experimental**

Treats `package.json#engines#node` as a valid Node.js version file ("dotfile"). So, if you have a package.json with the following content:

```json
{
  "engines": {
    "node": ">=20 <21"
  }
}
```

Then:

- `fnm install` will install the latest satisfying Node.js 20.x version available in the Node.js dist server
- `fnm use` will use the latest satisfying Node.js 20.x version available on your system, or prompt to install if no version matched.


================================================
FILE: docs/nightly.md
================================================
# Working with Node nightly builds

fnm doesn't give you any shorthands to install nightly builds, but you can
do that by manually passing a "dist mirror" with the `--node-dist-mirror` flag. 

## Example usage

Here's an example of installing Node 23.

To get a list of available versions run this:

    fnm --node-dist-mirror https://nodejs.org/download/nightly/ ls-remote

To use and install nightly version run this:

    fnm --node-dist-mirror https://nodejs.org/download/nightly/ use 23
    # or
    fnm --node-dist-mirror https://nodejs.org/download/nightly/ use v23.0.0-nightly202407253de7a4c374

Once you installed it you would be able to see that version in you list:

    fnm ls

And use it without providing `--node-dist-mirror` flag:

    fnm use 23


================================================
FILE: e2e/__snapshots__/aliases.test.ts.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Bash aliasing versions: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install 6.11.3
fnm install 8.11.3
fnm alias 8.11 oldie
fnm alias 6 older
fnm default older
((fnm ls) | grep 8.11.3 || (echo "Expected output to contain 8.11.3" && exit 1)) | grep oldie || (echo "Expected output to contain oldie" && exit 1)
((fnm ls) | grep 6.11.3 || (echo "Expected output to contain 6.11.3" && exit 1)) | grep older || (echo "Expected output to contain older" && exit 1)
fnm use older
if [ "$(node --version)" != "v6.11.3" ]; then
  echo "Expected node version to be v6.11.3. Got $(node --version)"
  exit 1
fi
fnm use oldie
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi
fnm use default
if [ "$(node --version)" != "v6.11.3" ]; then
  echo "Expected node version to be v6.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash allows to install an lts if version missing: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm use --install-if-missing
(fnm ls) | grep lts-latest || (echo "Expected output to contain lts-latest" && exit 1)"
`;

exports[`Bash can alias the system node: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm alias system my_system
(fnm ls) | grep my_system || (echo "Expected output to contain my_system" && exit 1)
fnm alias system default
fnm alias my_system my_system2
(fnm ls) | grep my_system2 || (echo "Expected output to contain my_system2" && exit 1)
(fnm use my_system) | grep 'Bypassing fnm' || (echo "Expected output to contain 'Bypassing fnm'" && exit 1)
fnm unalias my_system
(fnm use my_system 2>&1) | grep 'Requested version my_system is not currently installed' || (echo "Expected output to contain 'Requested version my_system is not currently installed'" && exit 1)"
`;

exports[`Bash errors when alias is not found: Bash 1`] = `
"set -e
eval "$(fnm env --log-level=error)"
(fnm use 2>&1) | grep 'Requested version lts-latest is not' || (echo "Expected output to contain 'Requested version lts-latest is not'" && exit 1)"
`;

exports[`Bash installs aliases when corepack is enabled: Bash 1`] = `
"set -e
eval "$(fnm env --corepack-enabled)"
fnm use --install-if-missing
(fnm ls) | grep lts-latest || (echo "Expected output to contain lts-latest" && exit 1)"
`;

exports[`Bash unalias a version: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install 11.10.0
fnm install 8.11.3
fnm alias 8.11.3 version8
(fnm ls) | grep version8 || (echo "Expected output to contain version8" && exit 1)
fnm unalias version8
(fnm use version8 2>&1) | grep 'Requested version version8 is not currently installed' || (echo "Expected output to contain 'Requested version version8 is not currently installed'" && exit 1)"
`;

exports[`Bash unalias errors if alias not found: Bash 1`] = `
"set -e
eval "$(fnm env --log-level=error)"
(fnm unalias lts 2>&1) | grep 'Requested alias lts not found' || (echo "Expected output to contain 'Requested alias lts not found'" && exit 1)"
`;

exports[`Fish aliasing versions: Fish 1`] = `
"fnm env | source
fnm install 6.11.3
fnm install 8.11.3
fnm alias 8.11 oldie
fnm alias 6 older
fnm default older
begin; begin; fnm ls; end | grep 8.11.3; or echo "Expected output to contain 8.11.3" && exit 1; end | grep oldie; or echo "Expected output to contain oldie" && exit 1
begin; begin; fnm ls; end | grep 6.11.3; or echo "Expected output to contain 6.11.3" && exit 1; end | grep older; or echo "Expected output to contain older" && exit 1
fnm use older
set ____test____ (node --version)
if test "$____test____" != "v6.11.3"
  echo "Expected node version to be v6.11.3. Got $____test____"
  exit 1
end
fnm use oldie
set ____test____ (node --version)
if test "$____test____" != "v8.11.3"
  echo "Expected node version to be v8.11.3. Got $____test____"
  exit 1
end
fnm use default
set ____test____ (node --version)
if test "$____test____" != "v6.11.3"
  echo "Expected node version to be v6.11.3. Got $____test____"
  exit 1
end"
`;

exports[`Fish allows to install an lts if version missing: Fish 1`] = `
"fnm env | source
fnm use --install-if-missing
begin; fnm ls; end | grep lts-latest; or echo "Expected output to contain lts-latest" && exit 1"
`;

exports[`Fish can alias the system node: Fish 1`] = `
"fnm env | source
fnm alias system my_system
begin; fnm ls; end | grep my_system; or echo "Expected output to contain my_system" && exit 1
fnm alias system default
fnm alias my_system my_system2
begin; fnm ls; end | grep my_system2; or echo "Expected output to contain my_system2" && exit 1
begin; fnm use my_system; end | grep 'Bypassing fnm'; or echo "Expected output to contain 'Bypassing fnm'" && exit 1
fnm unalias my_system
begin; fnm use my_system 2>&1; end | grep 'Requested version my_system is not currently installed'; or echo "Expected output to contain 'Requested version my_system is not currently installed'" && exit 1"
`;

exports[`Fish errors when alias is not found: Fish 1`] = `
"fnm env --log-level=error | source
begin; fnm use 2>&1; end | grep 'Requested version lts-latest is not'; or echo "Expected output to contain 'Requested version lts-latest is not'" && exit 1"
`;

exports[`Fish installs aliases when corepack is enabled: Fish 1`] = `
"fnm env --corepack-enabled | source
fnm use --install-if-missing
begin; fnm ls; end | grep lts-latest; or echo "Expected output to contain lts-latest" && exit 1"
`;

exports[`Fish unalias a version: Fish 1`] = `
"fnm env | source
fnm install 11.10.0
fnm install 8.11.3
fnm alias 8.11.3 version8
begin; fnm ls; end | grep version8; or echo "Expected output to contain version8" && exit 1
fnm unalias version8
begin; fnm use version8 2>&1; end | grep 'Requested version version8 is not currently installed'; or echo "Expected output to contain 'Requested version version8 is not currently installed'" && exit 1"
`;

exports[`Fish unalias errors if alias not found: Fish 1`] = `
"fnm env --log-level=error | source
begin; fnm unalias lts 2>&1; end | grep 'Requested alias lts not found'; or echo "Expected output to contain 'Requested alias lts not found'" && exit 1"
`;

exports[`PowerShell aliasing versions: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install 6.11.3
fnm install 8.11.3
fnm alias 8.11 oldie
fnm alias 6 older
fnm default older
$($__out__ = $($($__out__ = $(fnm ls | Select-String 8.11.3); if ($__out__ -eq $null) { exit 1 } else { $__out__ }) | Select-String oldie); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
$($__out__ = $($($__out__ = $(fnm ls | Select-String 6.11.3); if ($__out__ -eq $null) { exit 1 } else { $__out__ }) | Select-String older); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
fnm use older
if ( "$(node --version)" -ne "v6.11.3" ) { echo "Expected node version to be v6.11.3. Got $(node --version)"; exit 1 }
fnm use oldie
if ( "$(node --version)" -ne "v8.11.3" ) { echo "Expected node version to be v8.11.3. Got $(node --version)"; exit 1 }
fnm use default
if ( "$(node --version)" -ne "v6.11.3" ) { echo "Expected node version to be v6.11.3. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell allows to install an lts if version missing: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm use --install-if-missing
$($__out__ = $(fnm ls | Select-String lts-latest); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`PowerShell can alias the system node: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm alias system my_system
$($__out__ = $(fnm ls | Select-String my_system); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
fnm alias system default
fnm alias my_system my_system2
$($__out__ = $(fnm ls | Select-String my_system2); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
$($__out__ = $(fnm use my_system | Select-String 'Bypassing fnm'); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
fnm unalias my_system
$($__out__ = $(fnm use my_system 2>&1 | Select-String 'Requested version my_system is not currently installed'); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`PowerShell errors when alias is not found: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --log-level=error | Out-String | Invoke-Expression
$($__out__ = $(fnm use 2>&1 | Select-String 'Requested version lts-latest is not'); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`PowerShell installs aliases when corepack is enabled: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --corepack-enabled | Out-String | Invoke-Expression
fnm use --install-if-missing
$($__out__ = $(fnm ls | Select-String lts-latest); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`PowerShell unalias a version: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install 11.10.0
fnm install 8.11.3
fnm alias 8.11.3 version8
$($__out__ = $(fnm ls | Select-String version8); if ($__out__ -eq $null) { exit 1 } else { $__out__ })
fnm unalias version8
$($__out__ = $(fnm use version8 2>&1 | Select-String 'Requested version version8 is not currently installed'); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`PowerShell unalias errors if alias not found: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --log-level=error | Out-String | Invoke-Expression
$($__out__ = $(fnm unalias lts 2>&1 | Select-String 'Requested alias lts not found'); if ($__out__ -eq $null) { exit 1 } else { $__out__ })"
`;

exports[`Zsh aliasing versions: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install 6.11.3
fnm install 8.11.3
fnm alias 8.11 oldie
fnm alias 6 older
fnm default older
((fnm ls) | grep 8.11.3 || (echo "Expected output to contain 8.11.3" && exit 1)) | grep oldie || (echo "Expected output to contain oldie" && exit 1)
((fnm ls) | grep 6.11.3 || (echo "Expected output to contain 6.11.3" && exit 1)) | grep older || (echo "Expected output to contain older" && exit 1)
fnm use older
if [ "$(node --version)" != "v6.11.3" ]; then
  echo "Expected node version to be v6.11.3. Got $(node --version)"
  exit 1
fi
fnm use oldie
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi
fnm use default
if [ "$(node --version)" != "v6.11.3" ]; then
  echo "Expected node version to be v6.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh allows to install an lts if version missing: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm use --install-if-missing
(fnm ls) | grep lts-latest || (echo "Expected output to contain lts-latest" && exit 1)"
`;

exports[`Zsh can alias the system node: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm alias system my_system
(fnm ls) | grep my_system || (echo "Expected output to contain my_system" && exit 1)
fnm alias system default
fnm alias my_system my_system2
(fnm ls) | grep my_system2 || (echo "Expected output to contain my_system2" && exit 1)
(fnm use my_system) | grep 'Bypassing fnm' || (echo "Expected output to contain 'Bypassing fnm'" && exit 1)
fnm unalias my_system
(fnm use my_system 2>&1) | grep 'Requested version my_system is not currently installed' || (echo "Expected output to contain 'Requested version my_system is not currently installed'" && exit 1)"
`;

exports[`Zsh errors when alias is not found: Zsh 1`] = `
"set -e
eval "$(fnm env --log-level=error)"
(fnm use 2>&1) | grep 'Requested version lts-latest is not' || (echo "Expected output to contain 'Requested version lts-latest is not'" && exit 1)"
`;

exports[`Zsh installs aliases when corepack is enabled: Zsh 1`] = `
"set -e
eval "$(fnm env --corepack-enabled)"
fnm use --install-if-missing
(fnm ls) | grep lts-latest || (echo "Expected output to contain lts-latest" && exit 1)"
`;

exports[`Zsh unalias a version: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install 11.10.0
fnm install 8.11.3
fnm alias 8.11.3 version8
(fnm ls) | grep version8 || (echo "Expected output to contain version8" && exit 1)
fnm unalias version8
(fnm use version8 2>&1) | grep 'Requested version version8 is not currently installed' || (echo "Expected output to contain 'Requested version version8 is not currently installed'" && exit 1)"
`;

exports[`Zsh unalias errors if alias not found: Zsh 1`] = `
"set -e
eval "$(fnm env --log-level=error)"
(fnm unalias lts 2>&1) | grep 'Requested alias lts not found' || (echo "Expected output to contain 'Requested alias lts not found'" && exit 1)"
`;


================================================
FILE: e2e/__snapshots__/basic.test.ts.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Bash .node-version: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash .nvmrc: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash \`fnm ls\` with nothing installed: Bash 1`] = `
"set -e
eval "$(fnm env)"
if [ "$(fnm ls)" != "* system" ]; then
  echo "Expected fnm ls to be * system. Got $(fnm ls)"
  exit 1
fi"
`;

exports[`Bash basic usage: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install v8.11.3
fnm use v8.11.3
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash package.json engines.node with semver range: Bash 1`] = `
"set -e
eval "$(fnm env --resolve-engines)"
fnm install
fnm use
if [ "$(node --version)" != "v6.17.0" ]; then
  echo "Expected node version to be v6.17.0. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash package.json engines.node: Bash 1`] = `
"set -e
eval "$(fnm env --resolve-engines)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash resolves partial semver: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install 6
fnm use 6
if [ "$(node --version)" != "v6.17.1" ]; then
  echo "Expected node version to be v6.17.1. Got $(node --version)"
  exit 1
fi"
`;

exports[`Bash when .node-version and .nvmrc are in sync, it throws no error: Bash 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v11.10.0" ]; then
  echo "Expected node version to be v11.10.0. Got $(node --version)"
  exit 1
fi"
`;

exports[`Fish .node-version: Fish 1`] = `
"fnm env | source
fnm install
fnm use
set ____test____ (node --version)
if test "$____test____" != "v8.11.3"
  echo "Expected node version to be v8.11.3. Got $____test____"
  exit 1
end"
`;

exports[`Fish .nvmrc: Fish 1`] = `
"fnm env | source
fnm install
fnm use
set ____test____ (node --version)
if test "$____test____" != "v8.11.3"
  echo "Expected node version to be v8.11.3. Got $____test____"
  exit 1
end"
`;

exports[`Fish \`fnm ls\` with nothing installed: Fish 1`] = `
"fnm env | source
set ____test____ (fnm ls)
if test "$____test____" != "* system"
  echo "Expected fnm ls to be * system. Got $____test____"
  exit 1
end"
`;

exports[`Fish basic usage: Fish 1`] = `
"fnm env | source
fnm install v8.11.3
fnm use v8.11.3
set ____test____ (node --version)
if test "$____test____" != "v8.11.3"
  echo "Expected node version to be v8.11.3. Got $____test____"
  exit 1
end"
`;

exports[`Fish package.json engines.node with semver range: Fish 1`] = `
"fnm env --resolve-engines | source
fnm install
fnm use
set ____test____ (node --version)
if test "$____test____" != "v6.17.0"
  echo "Expected node version to be v6.17.0. Got $____test____"
  exit 1
end"
`;

exports[`Fish package.json engines.node: Fish 1`] = `
"fnm env --resolve-engines | source
fnm install
fnm use
set ____test____ (node --version)
if test "$____test____" != "v8.11.3"
  echo "Expected node version to be v8.11.3. Got $____test____"
  exit 1
end"
`;

exports[`Fish resolves partial semver: Fish 1`] = `
"fnm env | source
fnm install 6
fnm use 6
set ____test____ (node --version)
if test "$____test____" != "v6.17.1"
  echo "Expected node version to be v6.17.1. Got $____test____"
  exit 1
end"
`;

exports[`Fish when .node-version and .nvmrc are in sync, it throws no error: Fish 1`] = `
"fnm env | source
fnm install
fnm use
set ____test____ (node --version)
if test "$____test____" != "v11.10.0"
  echo "Expected node version to be v11.10.0. Got $____test____"
  exit 1
end"
`;

exports[`PowerShell .node-version: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install
fnm use
if ( "$(node --version)" -ne "v8.11.3" ) { echo "Expected node version to be v8.11.3. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell .nvmrc: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install
fnm use
if ( "$(node --version)" -ne "v8.11.3" ) { echo "Expected node version to be v8.11.3. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell \`fnm ls\` with nothing installed: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
if ( "$(fnm ls)" -ne "* system" ) { echo "Expected fnm ls to be * system. Got $(fnm ls)"; exit 1 }"
`;

exports[`PowerShell basic usage: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install v8.11.3
fnm use v8.11.3
if ( "$(node --version)" -ne "v8.11.3" ) { echo "Expected node version to be v8.11.3. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell package.json engines.node with semver range: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --resolve-engines | Out-String | Invoke-Expression
fnm install
fnm use
if ( "$(node --version)" -ne "v6.17.0" ) { echo "Expected node version to be v6.17.0. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell package.json engines.node: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --resolve-engines | Out-String | Invoke-Expression
fnm install
fnm use
if ( "$(node --version)" -ne "v8.11.3" ) { echo "Expected node version to be v8.11.3. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell resolves partial semver: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install 6
fnm use 6
if ( "$(node --version)" -ne "v6.17.1" ) { echo "Expected node version to be v6.17.1. Got $(node --version)"; exit 1 }"
`;

exports[`PowerShell when .node-version and .nvmrc are in sync, it throws no error: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env | Out-String | Invoke-Expression
fnm install
fnm use
if ( "$(node --version)" -ne "v11.10.0" ) { echo "Expected node version to be v11.10.0. Got $(node --version)"; exit 1 }"
`;

exports[`Zsh .node-version: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh .nvmrc: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh \`fnm ls\` with nothing installed: Zsh 1`] = `
"set -e
eval "$(fnm env)"
if [ "$(fnm ls)" != "* system" ]; then
  echo "Expected fnm ls to be * system. Got $(fnm ls)"
  exit 1
fi"
`;

exports[`Zsh basic usage: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install v8.11.3
fnm use v8.11.3
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh package.json engines.node with semver range: Zsh 1`] = `
"set -e
eval "$(fnm env --resolve-engines)"
fnm install
fnm use
if [ "$(node --version)" != "v6.17.0" ]; then
  echo "Expected node version to be v6.17.0. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh package.json engines.node: Zsh 1`] = `
"set -e
eval "$(fnm env --resolve-engines)"
fnm install
fnm use
if [ "$(node --version)" != "v8.11.3" ]; then
  echo "Expected node version to be v8.11.3. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh resolves partial semver: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install 6
fnm use 6
if [ "$(node --version)" != "v6.17.1" ]; then
  echo "Expected node version to be v6.17.1. Got $(node --version)"
  exit 1
fi"
`;

exports[`Zsh when .node-version and .nvmrc are in sync, it throws no error: Zsh 1`] = `
"set -e
eval "$(fnm env)"
fnm install
fnm use
if [ "$(node --version)" != "v11.10.0" ]; then
  echo "Expected node version to be v11.10.0. Got $(node --version)"
  exit 1
fi"
`;


================================================
FILE: e2e/__snapshots__/corepack.test.ts.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Bash installs corepack: Bash 1`] = `
"set -e
eval "$(fnm env --corepack-enabled)"
fnm install 18
fnm exec --using=18 node test-pnpm-corepack.js"
`;

exports[`Fish installs corepack: Fish 1`] = `
"fnm env --corepack-enabled | source
fnm install 18
fnm exec --using=18 node test-pnpm-corepack.js"
`;

exports[`PowerShell installs corepack: PowerShell 1`] = `
"$ErrorActionPreference = "Stop"
fnm env --corepack-enabled | Out-String | Invoke-Expression
fnm install 18
fnm exec --using=18 node test-pnpm-corepack.js"
`;

exports[`Zsh installs corepack: Zsh 1`] = `
"set -e
eval "$(fnm env --corepack-enabled)"
fnm install 18
fnm exec --using=18 node test-pnpm-corepack.js"
`;
Download .txt
gitextract_q8q0nzc1/

├── .changeset/
│   ├── README.md
│   ├── brave-timers-move.md
│   ├── config.json
│   ├── cuddly-cars-ring.md
│   └── fair-carrots-greet.md
├── .ci/
│   ├── get_shell_profile.sh
│   ├── install.sh
│   ├── prepare-static-build.sh
│   ├── prepare-version.js
│   ├── print-command-docs.js
│   ├── record_screen.sh
│   ├── recorded_screen_script.sh
│   ├── test_installation_script.sh
│   └── type-letters.js
├── .gitattributes
├── .github/
│   └── workflows/
│       ├── debug.yml
│       ├── installation_script.yml
│       ├── release-to-cargo.yml
│       ├── release.yml
│       └── rust.yml
├── .gitignore
├── .kodiak.toml
├── .node-version
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── README.md
├── benchmarks/
│   ├── basic/
│   │   ├── fnm
│   │   └── nvm
│   ├── run
│   └── run.mjs
├── build.rs
├── docs/
│   ├── commands.md
│   ├── configuration.md
│   └── nightly.md
├── e2e/
│   ├── __snapshots__/
│   │   ├── aliases.test.ts.snap
│   │   ├── basic.test.ts.snap
│   │   ├── corepack.test.ts.snap
│   │   ├── current.test.ts.snap
│   │   ├── env.test.ts.snap
│   │   ├── exec.test.ts.snap
│   │   ├── existing-installation.test.ts.snap
│   │   ├── latest-lts.test.ts.snap
│   │   ├── latest.test.ts.snap
│   │   ├── log-level.test.ts.snap
│   │   ├── multishell.test.ts.snap
│   │   ├── nvmrc-lts.test.ts.snap
│   │   ├── old-versions.test.ts.snap
│   │   ├── uninstall.test.ts.snap
│   │   └── use-on-cd.test.ts.snap
│   ├── aliases.test.ts
│   ├── basic.test.ts
│   ├── corepack.test.ts
│   ├── current.test.ts
│   ├── describe.ts
│   ├── env.test.ts
│   ├── exec.test.ts
│   ├── existing-installation.test.ts
│   ├── latest-lts.test.ts
│   ├── latest.test.ts
│   ├── log-level.test.ts
│   ├── multishell.test.ts
│   ├── nvmrc-lts.test.ts
│   ├── old-versions.test.ts
│   ├── shellcode/
│   │   ├── get-stderr.ts
│   │   ├── script.ts
│   │   ├── shells/
│   │   │   ├── cmdCall.ts
│   │   │   ├── cmdEnv.ts
│   │   │   ├── expect-command-output.ts
│   │   │   ├── output-contains.ts
│   │   │   ├── redirect-output.ts
│   │   │   ├── sub-shell.ts
│   │   │   └── types.ts
│   │   ├── shells.ts
│   │   ├── test-bin-dir.ts
│   │   ├── test-cwd.ts
│   │   ├── test-node-version.ts
│   │   └── test-tmp-dir.ts
│   ├── system-node.test.ts
│   ├── uninstall.test.ts
│   ├── use-on-cd.test.ts
│   └── windows-scoop.test.ts
├── fnm-manifest.rc
├── fnm.manifest
├── jest.config.cjs
├── jest.global-setup.js
├── jest.global-teardown.js
├── package.json
├── renovate.json
├── rust-toolchain.toml
├── site/
│   ├── package.json
│   └── vercel.json
├── src/
│   ├── alias.rs
│   ├── arch.rs
│   ├── archive/
│   │   ├── extract.rs
│   │   ├── mod.rs
│   │   ├── tar.rs
│   │   └── zip.rs
│   ├── choose_version_for_user_input.rs
│   ├── cli.rs
│   ├── commands/
│   │   ├── alias.rs
│   │   ├── command.rs
│   │   ├── completions.rs
│   │   ├── current.rs
│   │   ├── default.rs
│   │   ├── env.rs
│   │   ├── exec.rs
│   │   ├── install.rs
│   │   ├── ls_local.rs
│   │   ├── ls_remote.rs
│   │   ├── mod.rs
│   │   ├── unalias.rs
│   │   ├── uninstall.rs
│   │   └── use.rs
│   ├── config.rs
│   ├── current_version.rs
│   ├── default_version.rs
│   ├── directories.rs
│   ├── directory_portal.rs
│   ├── downloader.rs
│   ├── fs.rs
│   ├── http.rs
│   ├── installed_versions.rs
│   ├── log_level.rs
│   ├── lts.rs
│   ├── main.rs
│   ├── package_json.rs
│   ├── path_ext.rs
│   ├── pretty_serde.rs
│   ├── progress.rs
│   ├── remote_node_index.rs
│   ├── shell/
│   │   ├── bash.rs
│   │   ├── fish.rs
│   │   ├── infer/
│   │   │   ├── mod.rs
│   │   │   ├── unix.rs
│   │   │   └── windows.rs
│   │   ├── mod.rs
│   │   ├── powershell.rs
│   │   ├── shell.rs
│   │   ├── windows_cmd/
│   │   │   ├── cd.cmd
│   │   │   └── mod.rs
│   │   ├── windows_compat.rs
│   │   └── zsh.rs
│   ├── system_info.rs
│   ├── system_version.rs
│   ├── user_version.rs
│   ├── user_version_reader.rs
│   ├── version.rs
│   ├── version_file_strategy.rs
│   └── version_files.rs
├── tests/
│   └── proxy-server/
│       └── index.mjs
└── tsconfig.json
Download .txt
SYMBOL INDEX (389 symbols across 75 files)

FILE: .ci/prepare-version.js
  constant CARGO_TOML_PATH (line 11) | const CARGO_TOML_PATH = new URL("../Cargo.toml", import.meta.url).pathname
  method handler (line 17) | async handler({}) {
  function getPackageVersion (line 34) | async function getPackageVersion() {
  function updateCargoToml (line 44) | function updateCargoToml(nextVersion) {
  function exec (line 65) | function exec(command, env) {

FILE: .ci/print-command-docs.js
  method defaultValue (line 12) | defaultValue() {
  method handler (line 37) | async handler({ checkForDirty, fnmPath }) {
  function main (line 65) | async function main(targetFile, fnmPath) {
  function write (line 87) | function write(stream, content) {
  function line (line 93) | function line(cmd, text) {
  function getCommandHelp (line 104) | async function getCommandHelp(fnmPath, command) {
  function run (line 133) | function run(fnmPath, args) {
  function checkGitStatus (line 145) | async function checkGitStatus(targetFile) {

FILE: .ci/type-letters.js
  function sleep (line 11) | function sleep(ms) {

FILE: benchmarks/run.mjs
  method handler (line 68) | async handler({ serverUrl, githubToken, shouldStore }) {
  function round (line 227) | function round(number, digits) {
  function getFilesize (line 237) | async function getFilesize() {
  function runHyperfine (line 243) | async function runHyperfine() {

FILE: build.rs
  function main (line 1) | fn main() {

FILE: e2e/describe.ts
  function describe (line 4) | function describe(

FILE: e2e/shellcode/get-stderr.ts
  function getStderr (line 1) | function getStderr(script: string): string {

FILE: e2e/shellcode/script.ts
  class Script (line 13) | class Script {
    method constructor (line 14) | constructor(
    method then (line 21) | then(line: ScriptLine): Script {
    method takeSnapshot (line 25) | takeSnapshot(shell: Pick<Shell, "name">): this {
    method addExtraEnvVar (line 32) | addExtraEnvVar(name: string, value: string): this {
    method execute (line 40) | async execute(
    method asLine (line 117) | asLine(): ScriptLine {
  function streamOutputsAndBuffer (line 122) | function streamOutputsAndBuffer(child: ExecaChildProcess) {
  function padAllLines (line 154) | function padAllLines(text: string, padding: number): string {
  function write (line 161) | function write(writable: Writable, text: string): Promise<void> {
  function script (line 170) | function script(shell: Pick<Shell, "dieOnErrors">): Script {
  function removeAllFnmEnvVars (line 176) | function removeAllFnmEnvVars(obj: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
  function fnmTargetDir (line 186) | function fnmTargetDir(): string {

FILE: e2e/shellcode/shells/cmdCall.ts
  type HasCall (line 3) | type HasCall = {

FILE: e2e/shellcode/shells/cmdEnv.ts
  type EnvConfig (line 3) | type EnvConfig = {
  type HasEnv (line 11) | type HasEnv = { env(cfg: Partial<EnvConfig>): ScriptLine }
  function stringify (line 13) | function stringify(envConfig: Partial<EnvConfig> = {}) {

FILE: e2e/shellcode/shells/expect-command-output.ts
  type HasExpectCommandOutput (line 4) | type HasExpectCommandOutput = {
  method hasCommandOutput (line 14) | hasCommandOutput(script, output, message) {
  method hasCommandOutput (line 24) | hasCommandOutput(script, output, message) {
  method hasCommandOutput (line 35) | hasCommandOutput(script, output, message) {
  method hasCommandOutput (line 42) | hasCommandOutput(script, output, message) {

FILE: e2e/shellcode/shells/output-contains.ts
  type HasOutputContains (line 3) | type HasOutputContains = {

FILE: e2e/shellcode/shells/redirect-output.ts
  type RedirectOutputOpts (line 3) | type RedirectOutputOpts = { output: string }
  type HasRedirectOutput (line 4) | type HasRedirectOutput = {

FILE: e2e/shellcode/shells/sub-shell.ts
  type HasInSubShell (line 4) | type HasInSubShell = { inSubShell: (script: ScriptLine) => ScriptLine }

FILE: e2e/shellcode/shells/types.ts
  type Shell (line 1) | type Shell = {
  type ScriptLine (line 11) | type ScriptLine = string
  function define (line 13) | function define<S>(s: S): S {

FILE: e2e/shellcode/test-bin-dir.ts
  function testBinDir (line 5) | function testBinDir() {

FILE: e2e/shellcode/test-cwd.ts
  function testCwd (line 5) | function testCwd() {

FILE: e2e/shellcode/test-node-version.ts
  function testNodeVersion (line 5) | function testNodeVersion<

FILE: e2e/shellcode/test-tmp-dir.ts
  function testTmpDir (line 5) | function testTmpDir(): string {

FILE: e2e/system-node.test.ts
  function writeCustomNode (line 46) | async function writeCustomNode() {

FILE: src/alias.rs
  function create_alias (line 8) | pub fn create_alias(
  function list_aliases (line 25) | pub fn list_aliases(config: &FnmConfig) -> std::io::Result<Vec<StoredAli...
  function get_alias_by_name (line 33) | pub fn get_alias_by_name(config: &FnmConfig, alias_name: &str) -> Option...
  type StoredAlias (line 39) | pub struct StoredAlias {
    method s_ver (line 62) | pub fn s_ver(&self) -> &str {
    method name (line 76) | pub fn name(&self) -> &str {
    method path (line 84) | pub fn path(&self) -> &std::path::Path {
  type Error (line 45) | type Error = std::io::Error;
  function try_into (line 47) | fn try_into(self) -> Result<StoredAlias, Self::Error> {

FILE: src/arch.rs
  type Arch (line 4) | pub enum Arch {
    method as_str (line 17) | pub fn as_str(self) -> &'static str {
    type Err (line 59) | type Err = ArchError;
    method from_str (line 60) | fn from_str(s: &str) -> Result<Arch, Self::Err> {
    method fmt (line 77) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function get_safe_arch (line 34) | pub fn get_safe_arch(arch: Arch, version: &Version) -> Arch {
  function get_safe_arch (line 45) | pub fn get_safe_arch(arch: Arch, _version: &Version) -> Arch {
  method default (line 50) | fn default() -> Arch {
  type ArchError (line 83) | pub struct ArchError {
    method new (line 88) | fn new(msg: String) -> ArchError {
    method fmt (line 94) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    method description (line 100) | fn description(&self) -> &str {

FILE: src/archive/extract.rs
  type Error (line 5) | pub enum Error {
    method fmt (line 12) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    method from (line 24) | fn from(err: std::io::Error) -> Self {
    method from (line 30) | fn from(err: zip::result::ZipError) -> Self {
    method from (line 36) | fn from(err: crate::http::Error) -> Self {
  type Extract (line 41) | pub trait Extract {
    method extract_into (line 42) | fn extract_into(self: Box<Self>, path: &Path) -> Result<(), Error>;

FILE: src/archive/mod.rs
  type Archive (line 15) | pub enum Archive {
    method extract_archive_into (line 25) | pub fn extract_archive_into(&self, path: &Path, response: impl Read) -...
    method file_extension (line 38) | pub fn file_extension(&self) -> &'static str {
    method supported (line 50) | pub fn supported() -> &'static [Self] {
    method supported (line 55) | pub fn supported() -> &'static [Self] {

FILE: src/archive/tar.rs
  type Tar (line 4) | pub enum Tar<R: Read> {
  function extract_into_impl (line 12) | fn extract_into_impl<P: AsRef<Path>>(self, path: P) -> Result<(), Error> {
  method extract_into (line 24) | fn extract_into(self: Box<Self>, path: &Path) -> Result<(), Error> {

FILE: src/archive/zip.rs
  type Zip (line 9) | pub struct Zip<R: Read> {
  function new (line 15) | pub fn new(response: R) -> Self {
  method extract_into (line 21) | fn extract_into(mut self: Box<Self>, path: &Path) -> Result<(), Error> {
  function test_zip_extraction (line 87) | fn test_zip_extraction() {

FILE: src/choose_version_for_user_input.rs
  type ApplicableVersion (line 13) | pub struct ApplicableVersion {
    method path (line 19) | pub fn path(&self) -> &Path {
    method version (line 23) | pub fn version(&self) -> &Version {
  function choose_version_for_user_input (line 28) | pub fn choose_version_for_user_input<'a>(
  type Error (line 88) | pub enum Error {

FILE: src/cli.rs
  type SubCommand (line 7) | pub enum SubCommand {
    method call (line 75) | pub fn call(self, config: FnmConfig) {
  type Cli (line 96) | pub struct Cli {
  function parse (line 103) | pub fn parse() -> Cli {

FILE: src/commands/alias.rs
  type Alias (line 11) | pub struct Alias {
  type Error (line 17) | type Error = Error;
  method apply (line 19) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 34) | pub enum Error {

FILE: src/commands/command.rs
  type Command (line 5) | pub trait Command: Sized {
    method apply (line 7) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error>;
    method handle_error (line 9) | fn handle_error(err: Self::Error, config: &FnmConfig) {
    method call (line 15) | fn call(self, config: FnmConfig) {

FILE: src/commands/completions.rs
  type Completions (line 10) | pub struct Completions {
  type Error (line 17) | type Error = Error;
  method apply (line 19) | fn apply(self, _config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 35) | pub enum Error {
  function shells_as_string (line 46) | fn shells_as_string() -> String {
  function test_smoke (line 60) | fn test_smoke() {

FILE: src/commands/current.rs
  type Current (line 6) | pub struct Current {}
  type Error (line 9) | type Error = Error;
  method apply (line 11) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {

FILE: src/commands/default.rs
  type Default (line 8) | pub struct Default {
  type Error (line 13) | type Error = super::alias::Error;
  method apply (line 15) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  method handle_error (line 32) | fn handle_error(err: Self::Error, config: &FnmConfig) {

FILE: src/commands/env.rs
  type Env (line 16) | pub struct Env {
  function generate_symlink_path (line 31) | fn generate_symlink_path() -> String {
  function make_symlink (line 39) | fn make_symlink(config: &FnmConfig) -> Result<std::path::PathBuf, Error> {
  function bool_as_str (line 54) | fn bool_as_str(value: bool) -> &'static str {
  function set_path_for_multishell (line 62) | fn set_path_for_multishell(multishell_path: &std::path::Path) {
  type Error (line 80) | type Error = Error;
  method apply (line 82) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 174) | pub enum Error {
  function shells_as_string (line 196) | fn shells_as_string() -> String {
  function test_smoke (line 209) | fn test_smoke() {

FILE: src/commands/exec.rs
  type Exec (line 15) | pub struct Exec {
    method new_for_version (line 27) | pub(crate) fn new_for_version(
  type Error (line 46) | type Error = Error;
  method apply (line 48) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 113) | pub enum Error {

FILE: src/commands/install.rs
  type Install (line 20) | pub struct Install {
    method version (line 44) | fn version(self) -> Result<Option<UserVersion>, Error> {
  type Error (line 70) | type Error = Error;
  method apply (line 72) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  function tag_alias (line 183) | fn tag_alias(config: &FnmConfig, matched_version: &Version, alias: &Vers...
  function enable_corepack (line 195) | fn enable_corepack(version: &Version, config: &FnmConfig) -> Result<(), ...
  function use_installed_version (line 208) | fn use_installed_version(version: &Version, config: &FnmConfig) -> Resul...
  type Error (line 225) | pub enum Error {
  function test_set_default_on_new_installation (line 268) | fn test_set_default_on_new_installation() {
  function test_install_latest (line 296) | fn test_install_latest() {

FILE: src/commands/ls_local.rs
  type LsLocal (line 10) | pub struct LsLocal {}
    type Error (line 13) | type Error = Error;
    method apply (line 15) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  function generate_aliases_hash (line 50) | fn generate_aliases_hash(config: &FnmConfig) -> std::io::Result<HashMap<...
  type Error (line 64) | pub enum Error {

FILE: src/commands/ls_remote.rs
  type LsRemote (line 9) | pub struct LsRemote {
    type Error (line 51) | type Error = Error;
    method apply (line 53) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type SortingMethod (line 32) | pub enum SortingMethod {
  function truncate_except_latest (line 42) | fn truncate_except_latest<T>(list: &mut Vec<T>) {
  type Error (line 97) | pub enum Error {
  function test_truncate_except_latest (line 110) | fn test_truncate_except_latest() {

FILE: src/commands/unalias.rs
  type Unalias (line 9) | pub struct Unalias {
  type Error (line 14) | type Error = Error;
  method apply (line 16) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 35) | pub enum Error {

FILE: src/commands/uninstall.rs
  type Uninstall (line 14) | pub struct Uninstall {
  type Error (line 19) | type Error = Error;
  method apply (line 21) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  type Error (line 88) | pub enum Error {

FILE: src/commands/use.rs
  type Use (line 18) | pub struct Use {
  type Error (line 35) | type Error = Error;
  method apply (line 37) | fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> {
  function will_version_change (line 125) | fn will_version_change(resolved_path: &Path, config: &FnmConfig) -> bool {
  function install_new_version (line 133) | fn install_new_version(
  function replace_symlink (line 168) | fn replace_symlink(from: &std::path::Path, to: &std::path::Path) -> std:...
  function should_install_interactively (line 176) | fn should_install_interactively(requested_version: &UserVersion) -> bool {
  function warn_if_multishell_path_not_in_path_env_var (line 199) | fn warn_if_multishell_path_not_in_path_env_var(
  type Error (line 231) | pub enum Error {
  type InferVersionError (line 257) | pub enum InferVersionError {

FILE: src/config.rs
  type FnmConfig (line 9) | pub struct FnmConfig {
    method version_file_strategy (line 120) | pub fn version_file_strategy(&self) -> VersionFileStrategy {
    method corepack_enabled (line 124) | pub fn corepack_enabled(&self) -> bool {
    method resolve_engines (line 128) | pub fn resolve_engines(&self) -> bool {
    method multishell_path (line 132) | pub fn multishell_path(&self) -> Option<&std::path::Path> {
    method log_level (line 139) | pub fn log_level(&self) -> LogLevel {
    method base_dir_with_default (line 143) | pub fn base_dir_with_default(&self) -> std::path::PathBuf {
    method installations_dir (line 151) | pub fn installations_dir(&self) -> std::path::PathBuf {
    method default_version_dir (line 157) | pub fn default_version_dir(&self) -> std::path::PathBuf {
    method aliases_dir (line 161) | pub fn aliases_dir(&self) -> std::path::PathBuf {
    method multishell_storage (line 167) | pub fn multishell_storage(&self) -> std::path::PathBuf {
    method with_base_dir (line 172) | pub fn with_base_dir(mut self, base_dir: Option<std::path::PathBuf>) -...
    method with_multishell_path (line 177) | pub fn with_multishell_path(mut self, multishell_path: std::path::Path...
  method default (line 104) | fn default() -> Self {

FILE: src/current_version.rs
  function current_version (line 7) | pub fn current_version(config: &FnmConfig) -> Result<Option<Version>, Er...
  type Error (line 34) | pub enum Error {

FILE: src/default_version.rs
  function find_default_version (line 5) | pub fn find_default_version(config: &FnmConfig) -> Option<Version> {

FILE: src/directories.rs
  function xdg_dir (line 6) | fn xdg_dir(env: &str) -> Option<PathBuf> {
  function runtime_dir (line 16) | fn runtime_dir(basedirs: &impl BaseStrategy) -> Option<PathBuf> {
  function state_dir (line 20) | fn state_dir(basedirs: &impl BaseStrategy) -> Option<PathBuf> {
  function cache_dir (line 24) | fn cache_dir(basedirs: &impl BaseStrategy) -> PathBuf {
  type Directories (line 31) | pub struct Directories(
    method strategy (line 43) | pub fn strategy(&self) -> &impl BaseStrategy {
    method default_base_dir (line 47) | pub fn default_base_dir(&self) -> PathBuf {
    method multishell_storage (line 71) | pub fn multishell_storage(&self) -> PathBuf {
  method default (line 37) | fn default() -> Self {

FILE: src/directory_portal.rs
  type DirectoryPortal (line 10) | pub struct DirectoryPortal<P: AsRef<Path>> {
  function new_in (line 19) | pub fn new_in(parent_dir: impl AsRef<Path>, target: P) -> Self {
  function teleport (line 25) | pub fn teleport(self) -> std::io::Result<P> {
  type Target (line 37) | type Target = Path;
  function deref (line 38) | fn deref(&self) -> &Self::Target {
  function as_ref (line 44) | fn as_ref(&self) -> &Path {
  function test_portal (line 56) | fn test_portal() {

FILE: src/downloader.rs
  type Error (line 14) | pub enum Error {
  function filename_for_version (line 39) | fn filename_for_version(version: &Version, arch: Arch, ext: &str) -> Str...
  function filename_for_version (line 50) | fn filename_for_version(version: &Version, arch: Arch, ext: &str) -> Str...
  function download_url (line 59) | fn download_url(base_url: &Url, version: &Version, arch: Arch, ext: &str...
  function install_node_dist (line 70) | pub fn install_node_dist<P: AsRef<Path>>(
  function test_installing_node_12 (line 141) | fn test_installing_node_12() {
  function test_installing_npm (line 157) | fn test_installing_npm() {
  function install_in (line 174) | fn install_in(path: &Path) -> PathBuf {

FILE: src/fs.rs
  function symlink_dir (line 4) | pub fn symlink_dir<P: AsRef<Path>, U: AsRef<Path>>(from: P, to: U) -> st...
  function symlink_dir (line 10) | pub fn symlink_dir<P: AsRef<Path>, U: AsRef<Path>>(from: P, to: U) -> st...
  function remove_symlink_dir (line 16) | pub fn remove_symlink_dir<P: AsRef<Path>>(path: P) -> std::io::Result<()> {
  function remove_symlink_dir (line 22) | pub fn remove_symlink_dir<P: AsRef<Path>>(path: P) -> std::io::Result<()> {
  function shallow_read_symlink (line 27) | pub fn shallow_read_symlink<P: AsRef<Path>>(path: P) -> std::io::Result<...

FILE: src/http.rs
  type Error (line 10) | pub struct Error(#[from] reqwest::Error);
  type Response (line 11) | pub type Response = reqwest::blocking::Response;
  function get (line 13) | pub fn get(url: impl IntoUrl) -> Result<Response, Error> {

FILE: src/installed_versions.rs
  function list (line 5) | pub fn list<P: AsRef<Path>>(installations_dir: P) -> Result<Vec<Version>...
  type Error (line 30) | pub enum Error {

FILE: src/log_level.rs
  type LogLevel (line 6) | pub enum LogLevel {
    method as_str (line 15) | pub fn as_str(self) -> &'static str {
    method is_writable (line 23) | pub fn is_writable(self, logging: Self) -> bool {
    method writer_for (line 28) | pub fn writer_for(self, logging: Self) -> Box<dyn std::io::Write> {
    method possible_values (line 39) | pub fn possible_values() -> &'static [&'static str; 4] {
  method fmt (line 45) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function test_is_writable (line 63) | fn test_is_writable() {

FILE: src/lts.rs
  type LtsType (line 5) | pub enum LtsType {
    method from (line 13) | fn from(s: &str) -> Self {
    method pick_latest (line 32) | pub fn pick_latest<'vec>(
  method fmt (line 23) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

FILE: src/main.rs
  function main (line 42) | fn main() {

FILE: src/package_json.rs
  type EnginesField (line 4) | struct EnginesField {
  type PackageJson (line 9) | pub struct PackageJson {
    method node_range (line 14) | pub fn node_range(&self) -> Option<&node_semver::Range> {

FILE: src/path_ext.rs
  type PathExt (line 3) | pub trait PathExt {
    method ensure_exists_silently (line 4) | fn ensure_exists_silently(self) -> Self;
    method ensure_exists_silently (line 10) | fn ensure_exists_silently(self) -> Self {

FILE: src/pretty_serde.rs
  type DecodeError (line 5) | pub struct DecodeError {
    method from_serde (line 24) | pub fn from_serde(input: impl Into<String>, cause: serde_json::Error) ...
    method report (line 34) | pub fn report(&self) -> String {
  type ClonedError (line 15) | pub struct ClonedError {

FILE: src/progress.rs
  type ResponseProgress (line 6) | pub struct ResponseProgress {
    method new (line 46) | pub fn new(response: Response, target: ProgressDrawTarget) -> Self {
    method finish (line 55) | pub fn finish(&self) {
  type ProgressConfig (line 12) | pub enum ProgressConfig {
    method enabled (line 20) | pub fn enabled(&self, config: &crate::config::FnmConfig) -> bool {
  function make_progress_bar (line 31) | fn make_progress_bar(size: u64, target: ProgressDrawTarget) -> ProgressB...
  method read (line 63) | fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
  method drop (line 75) | fn drop(&mut self) {
  constant CONTENT_LENGTH (line 92) | const CONTENT_LENGTH: usize = 100;
  type MockedTerm (line 95) | struct MockedTerm {
  method width (line 100) | fn width(&self) -> u16 {
  method move_cursor_up (line 104) | fn move_cursor_up(&self, _n: usize) -> std::io::Result<()> {
  method move_cursor_down (line 108) | fn move_cursor_down(&self, _n: usize) -> std::io::Result<()> {
  method move_cursor_right (line 112) | fn move_cursor_right(&self, _n: usize) -> std::io::Result<()> {
  method move_cursor_left (line 116) | fn move_cursor_left(&self, _n: usize) -> std::io::Result<()> {
  method write_line (line 120) | fn write_line(&self, s: &str) -> std::io::Result<()> {
  method write_str (line 125) | fn write_str(&self, s: &str) -> std::io::Result<()> {
  method clear_line (line 130) | fn clear_line(&self) -> std::io::Result<()> {
  method flush (line 134) | fn flush(&self) -> std::io::Result<()> {
  function test_reads_data_and_shows_progress (line 140) | fn test_reads_data_and_shows_progress() {

FILE: src/remote_node_index.rs
  type LtsStatus (line 10) | enum LtsStatus {
  function from (line 16) | fn from(status: LtsStatus) -> Self {
  function deserialize (line 24) | pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<String>, D:...
  type TestSubject (line 37) | struct TestSubject {
  function test_false_deserialization (line 43) | fn test_false_deserialization() {
  function test_value_deserialization (line 51) | fn test_value_deserialization() {
  type IndexedNodeVersion (line 61) | pub struct IndexedNodeVersion {
  type Error (line 70) | pub enum Error {
  function list (line 84) | pub fn list(base_url: &Url) -> Result<Vec<IndexedNodeVersion>, Error> {
  function test_list (line 103) | fn test_list() {

FILE: src/shell/bash.rs
  type Bash (line 8) | pub struct Bash;
  method to_clap_shell (line 11) | fn to_clap_shell(&self) -> clap_complete::Shell {
  method path (line 15) | fn path(&self, path: &Path) -> anyhow::Result<String> {
  method set_env_var (line 24) | fn set_env_var(&self, name: &str, value: &str) -> String {
  method use_on_cd (line 28) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Result...

FILE: src/shell/fish.rs
  type Fish (line 8) | pub struct Fish;
  method to_clap_shell (line 11) | fn to_clap_shell(&self) -> clap_complete::Shell {
  method path (line 15) | fn path(&self, path: &Path) -> anyhow::Result<String> {
  method set_env_var (line 24) | fn set_env_var(&self, name: &str, value: &str) -> String {
  method use_on_cd (line 28) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Result...

FILE: src/shell/infer/mod.rs
  function shell_from_string (line 10) | fn shell_from_string(shell: &str) -> Option<Box<dyn super::Shell>> {

FILE: src/shell/infer/unix.rs
  type ProcessInfo (line 9) | struct ProcessInfo {
  constant MAX_ITERATIONS (line 14) | const MAX_ITERATIONS: u8 = 10;
  function infer_shell (line 16) | pub fn infer_shell() -> Option<Box<dyn Shell>> {
  function get_process_info (line 48) | fn get_process_info(pid: u32) -> Result<ProcessInfo, ProcessInfoError> {
  type ProcessInfoError (line 89) | enum ProcessInfoError {
  function test_get_process_info (line 110) | fn test_get_process_info() -> anyhow::Result<()> {

FILE: src/shell/infer/windows.rs
  function infer_shell (line 7) | pub fn infer_shell() -> Option<Box<dyn Shell>> {
  function tap_none (line 47) | fn tap_none<T, F>(opt: Option<T>, f: F) -> Option<T>

FILE: src/shell/powershell.rs
  type PowerShell (line 8) | pub struct PowerShell;
  method path (line 11) | fn path(&self, path: &Path) -> anyhow::Result<String> {
  method set_env_var (line 24) | fn set_env_var(&self, name: &str, value: &str) -> String {
  method use_on_cd (line 28) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Result...
  method to_clap_shell (line 53) | fn to_clap_shell(&self) -> clap_complete::Shell {

FILE: src/shell/shell.rs
  type Shell (line 6) | pub trait Shell: Debug {
    method path (line 7) | fn path(&self, path: &Path) -> anyhow::Result<String>;
    method set_env_var (line 8) | fn set_env_var(&self, name: &str, value: &str) -> String;
    method use_on_cd (line 9) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Resu...
    method rehash (line 10) | fn rehash(&self) -> Option<&'static str> {
    method to_clap_shell (line 13) | fn to_clap_shell(&self) -> clap_complete::Shell;
  type Shells (line 17) | pub enum Shells {
  method fmt (line 28) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function from (line 41) | fn from(shell: Shells) -> Box<dyn Shell> {
  function from (line 54) | fn from(shell: Box<dyn Shell>) -> Self {

FILE: src/shell/windows_cmd/mod.rs
  type WindowsCmd (line 5) | pub struct WindowsCmd;
  method to_clap_shell (line 8) | fn to_clap_shell(&self) -> clap_complete::Shell {
  method path (line 13) | fn path(&self, path: &Path) -> anyhow::Result<String> {
  method set_env_var (line 26) | fn set_env_var(&self, name: &str, value: &str) -> String {
  method use_on_cd (line 30) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Result...
  function create_cd_file_at (line 46) | fn create_cd_file_at(path: &std::path::Path) -> std::io::Result<()> {
  function use_on_cd_quotes_macro_path (line 59) | fn use_on_cd_quotes_macro_path() {

FILE: src/shell/windows_compat.rs
  function maybe_fix_windows_path (line 6) | pub fn maybe_fix_windows_path(path: &str) -> Option<String> {

FILE: src/shell/zsh.rs
  type Zsh (line 8) | pub struct Zsh;
  method to_clap_shell (line 11) | fn to_clap_shell(&self) -> clap_complete::Shell {
  method path (line 15) | fn path(&self, path: &Path) -> anyhow::Result<String> {
  method set_env_var (line 24) | fn set_env_var(&self, name: &str, value: &str) -> String {
  method rehash (line 28) | fn rehash(&self) -> Option<&'static str> {
  method use_on_cd (line 32) | fn use_on_cd(&self, config: &crate::config::FnmConfig) -> anyhow::Result...
  function use_on_cd_removes_existing_hook_before_adding (line 69) | fn use_on_cd_removes_existing_hook_before_adding() {

FILE: src/system_info.rs
  function platform_name (line 2) | pub fn platform_name() -> &'static str {
  function platform_name (line 7) | pub fn platform_name() -> &'static str {
  function platform_arch (line 15) | pub fn platform_arch() -> &'static str {
  function platform_arch (line 23) | pub fn platform_arch() -> &'static str {
  function platform_arch (line 31) | pub fn platform_arch() -> &'static str {
  function platform_arch (line 39) | pub fn platform_arch() -> &'static str {

FILE: src/system_version.rs
  function path (line 3) | pub fn path() -> PathBuf {
  function display_name (line 13) | pub fn display_name() -> &'static str {

FILE: src/user_version.rs
  type UserVersion (line 5) | pub enum UserVersion {
    method to_version (line 13) | pub fn to_version<'a, T>(
    method alias_name (line 27) | pub fn alias_name(&self) -> Option<String> {
    method matches (line 34) | pub fn matches(&self, version: &Version, config: &crate::config::FnmCo...
    method inferred_alias (line 55) | pub fn inferred_alias(&self) -> Option<Version> {
    method fmt (line 70) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function next_of (line 64) | fn next_of<'a, T: FromStr, It: Iterator<Item = &'a str>>(i: &mut It) -> ...
  function skip_first_v (line 80) | fn skip_first_v(str: &str) -> &str {
  type Err (line 85) | type Err = node_semver::SemverError;
  method from_str (line 86) | fn from_str(s: &str) -> Result<UserVersion, Self::Err> {
  method eq (line 103) | fn eq(&self, other: &Self) -> bool {
  function test_parsing_only_major (line 120) | fn test_parsing_only_major() {
  function test_parsing_major_minor (line 126) | fn test_parsing_major_minor() {
  function test_parsing_only_major_with_v (line 132) | fn test_parsing_only_major_with_v() {
  function test_major_to_version (line 138) | fn test_major_to_version() {
  function test_major_minor_to_version (line 152) | fn test_major_minor_to_version() {
  function test_semver_to_version (line 166) | fn test_semver_to_version() {

FILE: src/user_version_reader.rs
  type UserVersionReader (line 8) | pub enum UserVersionReader {
    method into_user_version (line 14) | pub fn into_user_version(self, config: &FnmConfig) -> Option<UserVersi...
  type Err (line 24) | type Err = node_semver::SemverError;
  method from_str (line 26) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  function test_file_pathbuf_to_version (line 46) | fn test_file_pathbuf_to_version() {
  function test_directory_pathbuf_to_version (line 57) | fn test_directory_pathbuf_to_version() {
  function test_direct_to_version (line 69) | fn test_direct_to_version() {
  function test_from_str_directory (line 76) | fn test_from_str_directory() {
  function test_from_str_file (line 87) | fn test_from_str_file() {
  function test_non_existing_path (line 97) | fn test_non_existing_path() {
  function test_a_version_number (line 109) | fn test_a_version_number() {

FILE: src/version.rs
  type Version (line 8) | pub enum Version {
    method parse (line 21) | pub fn parse<S: AsRef<str>>(version_str: S) -> Result<Self, node_semve...
    method alias_name (line 37) | pub fn alias_name(&self) -> Option<String> {
    method find_aliases (line 44) | pub fn find_aliases(
    method v_str (line 55) | pub fn v_str(&self) -> String {
    method installation_path (line 59) | pub fn installation_path(&self, config: &config::FnmConfig) -> std::pa...
    method root_path (line 72) | pub fn root_path(&self, config: &config::FnmConfig) -> Option<std::pat...
    method deserialize (line 84) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    method fmt (line 94) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    method eq (line 113) | fn eq(&self, other: &node_semver::Version) -> bool {
  function first_letter_is_number (line 16) | fn first_letter_is_number(s: &str) -> bool {
  type Err (line 106) | type Err = node_semver::SemverError;
  method from_str (line 107) | fn from_str(s: &str) -> Result<Version, Self::Err> {

FILE: src/version_file_strategy.rs
  type VersionFileStrategy (line 5) | pub enum VersionFileStrategy {
    method as_str (line 14) | pub fn as_str(self) -> &'static str {
  method fmt (line 23) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

FILE: src/version_files.rs
  constant PATH_PARTS (line 12) | const PATH_PARTS: [&str; 3] = [".nvmrc", ".node-version", "package.json"];
  function get_user_version_for_directory (line 14) | pub fn get_user_version_for_directory(
  function get_user_version_for_directory_recursive (line 28) | fn get_user_version_for_directory_recursive(
  function get_user_version_for_single_directory (line 45) | fn get_user_version_for_single_directory(
  function get_user_version_for_file (line 66) | pub fn get_user_version_for_file(
Condensed preview — 152 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (426K chars).
[
  {
    "path": ".changeset/README.md",
    "chars": 510,
    "preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
  },
  {
    "path": ".changeset/brave-timers-move.md",
    "chars": 97,
    "preview": "---\n\"fnm\": patch\n---\n\nsupport `x64-glibc-217` arch by adding a `--arch x64-glibc-217` to fnm env\n"
  },
  {
    "path": ".changeset/config.json",
    "chars": 308,
    "preview": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@2.0.0/schema.json\",\n  \"changelog\": [\"@changesets/changelog-github\","
  },
  {
    "path": ".changeset/cuddly-cars-ring.md",
    "chars": 129,
    "preview": "---\n\"fnm\": patch\n---\n\nprefer explicit shell flags in installer-generated shell setup and fix ARM installer CI platform s"
  },
  {
    "path": ".changeset/fair-carrots-greet.md",
    "chars": 170,
    "preview": "---\n\"fnm\": patch\n---\n\nClarify the interactive `fnm use` missing-version prompt by prefixing the message with `fnm` so it"
  },
  {
    "path": ".ci/get_shell_profile.sh",
    "chars": 298,
    "preview": "#!/bin/bash\n\ncase $1 in\n  \"fish\")\n    echo \"$HOME/.config/fish/conf.d/fnm.fish\"\n    ;;\n  \"zsh\")\n    echo \"$HOME/.zshrc\"\n"
  },
  {
    "path": ".ci/install.sh",
    "chars": 5891,
    "preview": "#!/bin/bash\n\nset -e\n\nRELEASE=\"latest\"\nOS=\"$(uname -s)\"\n\ncase \"${OS}\" in\n   MINGW* | Win*) OS=\"Windows\" ;;\nesac\n\nif [ -d "
  },
  {
    "path": ".ci/prepare-static-build.sh",
    "chars": 70,
    "preview": "sed -i 's@\"flags\": \\[\\]@\"flags\": [\"-ccopt\", \"-static\"]@' package.json\n"
  },
  {
    "path": ".ci/prepare-version.js",
    "chars": 1719,
    "preview": "#!/usr/bin/env node\n\n/// @ts-check\n\nimport fs from \"fs\"\nimport cp from \"child_process\"\nimport cmd from \"cmd-ts\"\nimport t"
  },
  {
    "path": ".ci/print-command-docs.js",
    "chars": 3982,
    "preview": "#!/usr/bin/env node\n\n/// @ts-check\n\nimport { execa } from \"execa\"\nimport fs from \"node:fs\"\nimport cmd from \"cmd-ts\"\nimpo"
  },
  {
    "path": ".ci/record_screen.sh",
    "chars": 728,
    "preview": "#!/bin/bash\n\nDIRECTORY=\"$(dirname \"$0\")\"\n\nfunction setup_binary() {\n  TEMP_DIR=\"/tmp/fnm-$(date '+%s')\"\n  mkdir \"$TEMP_D"
  },
  {
    "path": ".ci/recorded_screen_script.sh",
    "chars": 410,
    "preview": "#!/bin/bash\n\nset -e\n\nexport PATH=$PATH_ADDITION:$PATH\n\nGAL_PROMPT_PREFIX=\"\\e[34m✡\\e[m  \"\n\nfunction type() {\n  printf $GA"
  },
  {
    "path": ".ci/test_installation_script.sh",
    "chars": 546,
    "preview": "#!/bin/bash\n\nset -e\n\nDIRECTORY=\"$(dirname \"$0\")\"\nSHELL_TO_RUN=\"$1\"\nPROFILE_FILE=\"$(\"$DIRECTORY/get_shell_profile.sh\" \"$S"
  },
  {
    "path": ".ci/type-letters.js",
    "chars": 331,
    "preview": "(async () => {\n  for await (const chunk of process.stdin) {\n    const letters = chunk.toString(\"utf8\").split(\"\");\n    fo"
  },
  {
    "path": ".gitattributes",
    "chars": 200,
    "preview": "*__Fish.snap linguist-language=fish\n*__Zsh.snap linguist-language=Shell\n*__Bash.snap linguist-language=Shell\n*__PowerShe"
  },
  {
    "path": ".github/workflows/debug.yml",
    "chars": 1779,
    "preview": "name: \"debug\"\n\non:\n  workflow_dispatch:\n\nconcurrency:\n  group: debug\n  cancel-in-progress: true\n\njobs:\n  e2e_windows_deb"
  },
  {
    "path": ".github/workflows/installation_script.yml",
    "chars": 2787,
    "preview": "name: Installation script\non:\n  pull_request:\n    paths:\n      - .ci/install.sh\n  push:\n    branches:\n      - master\n   "
  },
  {
    "path": ".github/workflows/release-to-cargo.yml",
    "chars": 646,
    "preview": "name: release to cargo\non:\n  workflow_dispatch:\n  push:\n    tags: ['*']\njobs:\n  publish_to_crates_io:\n    runs-on: ubunt"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1449,
    "preview": "name: release\non:\n  push:\n    branches:\n      - master\n      - main\n\nconcurrency: ${{ github.workflow }}-${{ github.ref "
  },
  {
    "path": ".github/workflows/rust.yml",
    "chars": 14244,
    "preview": "name: Rust\n\non:\n  pull_request:\n  push:\n    branches:\n      - master\n\nconcurrency:\n  group: ci-${{ github.head_ref }}\n  "
  },
  {
    "path": ".gitignore",
    "chars": 127,
    "preview": "node_modules/\n.ci/screen_recording\n/benchmarks/results\n/target\n**/*.rs.bk\nfeature_tests/.tmp\n*.log\n/site/public\n.vercel\n"
  },
  {
    "path": ".kodiak.toml",
    "chars": 12,
    "preview": "version = 1\n"
  },
  {
    "path": ".node-version",
    "chars": 8,
    "preview": "20.14.0\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 50009,
    "preview": "## 1.31.0 (2022-02-16)\n\n## 1.39.0\n\n### Minor Changes\n\n- [#1516](https://github.com/Schniz/fnm/pull/1516) [`10c68cb`](htt"
  },
  {
    "path": "Cargo.toml",
    "chars": 1298,
    "preview": "[package]\nname = \"fnm\"\nversion = \"1.39.0\"\nauthors = [\"Gal Schlezinger <gal@spitfire.co.il>\"]\nedition = \"2021\"\nbuild = \"b"
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 6993,
    "preview": "<h1 align=\"center\">\n  Fast Node Manager (<code>fnm</code>)\n  <img alt=\"Amount of downloads\" src=\"https://img.shields.io/"
  },
  {
    "path": "benchmarks/basic/fnm",
    "chars": 90,
    "preview": "#!/bin/bash\n\neval \"$(fnm env --shell=bash)\"\nfnm install v10.11.0\nfnm use v10.11.0\nnode -v\n"
  },
  {
    "path": "benchmarks/basic/nvm",
    "chars": 127,
    "preview": "#!/bin/bash\n\nexport NVM_DIR=\"$HOME/.nvm\"\n\\. \"$NVM_DIR/nvm.sh\"  # This loads nvm\n\nnvm install v10.11.0\nnvm use v10.11.0\nn"
  },
  {
    "path": "benchmarks/run",
    "chars": 871,
    "preview": "#!/bin/bash\n\nset -e\n\nexport FNM_DIR\n\nBASE_DIR=\"$(dirname \"$(realpath \"$0\")\")\"\ncd \"$BASE_DIR\" || exit 1\n\nFNM_DIR=\"$(mktem"
  },
  {
    "path": "benchmarks/run.mjs",
    "chars": 6661,
    "preview": "// @ts-check\n\nimport z from \"zod\"\nimport os from \"node:os\"\nimport path from \"node:path\"\nimport fetch from \"node-fetch\"\ni"
  },
  {
    "path": "build.rs",
    "chars": 84,
    "preview": "fn main() {\n    embed_resource::compile(\"fnm-manifest.rc\", embed_resource::NONE);\n}\n"
  },
  {
    "path": "docs/commands.md",
    "chars": 32687,
    "preview": "# `fnm`\n\n```\nA fast and simple Node.js manager\n\nUsage: fnm [OPTIONS] <COMMAND>\n\nCommands:\n  list-remote  List all remote"
  },
  {
    "path": "docs/configuration.md",
    "chars": 2577,
    "preview": "# Configuration\n\nfnm comes with many features out of the box. Some of them are not activated by default as they’re chang"
  },
  {
    "path": "docs/nightly.md",
    "chars": 762,
    "preview": "# Working with Node nightly builds\n\nfnm doesn't give you any shorthands to install nightly builds, but you can\ndo that b"
  },
  {
    "path": "e2e/__snapshots__/aliases.test.ts.snap",
    "chars": 12529,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash aliasing versions: Bash 1`] = `\n\"set -e\neval \"$(fnm env)\"\nfnm "
  },
  {
    "path": "e2e/__snapshots__/basic.test.ts.snap",
    "chars": 8095,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash .node-version: Bash 1`] = `\n\"set -e\neval \"$(fnm env)\"\nfnm inst"
  },
  {
    "path": "e2e/__snapshots__/corepack.test.ts.snap",
    "chars": 725,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash installs corepack: Bash 1`] = `\n\"set -e\neval \"$(fnm env --core"
  },
  {
    "path": "e2e/__snapshots__/current.test.ts.snap",
    "chars": 3113,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash current returns the current Node.js version set in fnm: Bash 1"
  },
  {
    "path": "e2e/__snapshots__/env.test.ts.snap",
    "chars": 417,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash outputs json: Bash 1`] = `\n\"set -e\nfnm env --json > file.json\""
  },
  {
    "path": "e2e/__snapshots__/exec.test.ts.snap",
    "chars": 2360,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash \\`exec\\` usage: Bash 1`] = `\n\"set -e\nfnm install\nfnm install v"
  },
  {
    "path": "e2e/__snapshots__/existing-installation.test.ts.snap",
    "chars": 1067,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash warns about an existing installation: Bash 1`] = `\n\"set -e\neva"
  },
  {
    "path": "e2e/__snapshots__/latest-lts.test.ts.snap",
    "chars": 920,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash installs latest lts: Bash 1`] = `\n\"set -e\neval \"$(fnm env)\"\nfn"
  },
  {
    "path": "e2e/__snapshots__/latest.test.ts.snap",
    "chars": 892,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash installs latest: Bash 1`] = `\n\"set -e\neval \"$(fnm env)\"\nfnm in"
  },
  {
    "path": "e2e/__snapshots__/log-level.test.ts.snap",
    "chars": 4408,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash \"quiet\" log level: Bash 1`] = `\n\"set -e\neval \"$(fnm env --log-"
  },
  {
    "path": "e2e/__snapshots__/multishell.test.ts.snap",
    "chars": 1933,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash multishell changes don't affect parent: Bash 1`] = `\n\"set -e\ne"
  },
  {
    "path": "e2e/__snapshots__/nvmrc-lts.test.ts.snap",
    "chars": 919,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash uses .nvmrc with lts definition: Bash 1`] = `\n\"set -e\neval \"$("
  },
  {
    "path": "e2e/__snapshots__/old-versions.test.ts.snap",
    "chars": 1120,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash download old Node.js 0.10.x: Bash 1`] = `\n\"set -e\neval \"$(fnm "
  },
  {
    "path": "e2e/__snapshots__/uninstall.test.ts.snap",
    "chars": 1632,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash uninstalls a version: Bash 1`] = `\n\"set -e\nfnm i 12.0.0\nfnm al"
  },
  {
    "path": "e2e/__snapshots__/use-on-cd.test.ts.snap",
    "chars": 1160,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Bash use on cd: Bash 1`] = `\n\"set -e\neval \"$(fnm env --use-on-cd)\"\n"
  },
  {
    "path": "e2e/aliases.test.ts",
    "chars": 5001,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/basic.test.ts",
    "chars": 3511,
    "preview": "import { writeFile } from \"node:fs/promises\"\nimport { join } from \"node:path\"\nimport { script } from \"./shellcode/script"
  },
  {
    "path": "e2e/corepack.test.ts",
    "chars": 1662,
    "preview": "import fs from \"fs\"\nimport { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellc"
  },
  {
    "path": "e2e/current.test.ts",
    "chars": 1442,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, WinCmd, Zsh } from \"./shellcode/shells.j"
  },
  {
    "path": "e2e/describe.ts",
    "chars": 490,
    "preview": "import { WinCmd } from \"./shellcode/shells.js\"\nimport { Shell } from \"./shellcode/shells/types.js\"\n\nexport default funct"
  },
  {
    "path": "e2e/env.test.ts",
    "chars": 1192,
    "preview": "import { readFile } from \"node:fs/promises\"\nimport { join } from \"node:path\"\nimport { script } from \"./shellcode/script."
  },
  {
    "path": "e2e/exec.test.ts",
    "chars": 1302,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, WinCmd, Zsh } from \"./shellcode/shells.j"
  },
  {
    "path": "e2e/existing-installation.test.ts",
    "chars": 699,
    "preview": "import getStderr from \"./shellcode/get-stderr.js\"\nimport { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, Po"
  },
  {
    "path": "e2e/latest-lts.test.ts",
    "chars": 611,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/latest.test.ts",
    "chars": 607,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/log-level.test.ts",
    "chars": 1837,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/multishell.test.ts",
    "chars": 905,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/nvmrc-lts.test.ts",
    "chars": 786,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/old-versions.test.ts",
    "chars": 836,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, WinCmd, Zsh } from \"./shellcode/shells.j"
  },
  {
    "path": "e2e/shellcode/get-stderr.ts",
    "chars": 88,
    "preview": "export default function getStderr(script: string): string {\n  return `${script} 2>&1`\n}\n"
  },
  {
    "path": "e2e/shellcode/script.ts",
    "chars": 5098,
    "preview": "import { ScriptLine, Shell } from \"./shells/types.js\"\nimport { execa, type ExecaChildProcess } from \"execa\"\nimport testT"
  },
  {
    "path": "e2e/shellcode/shells/cmdCall.ts",
    "chars": 286,
    "preview": "import { define, ScriptLine } from \"./types.js\"\n\nexport type HasCall = {\n  call: (binary: string, args: string[]) => Scr"
  },
  {
    "path": "e2e/shellcode/shells/cmdEnv.ts",
    "chars": 1264,
    "preview": "import { ScriptLine, define } from \"./types.js\"\n\ntype EnvConfig = {\n  executableName: string\n  useOnCd: boolean\n  logLev"
  },
  {
    "path": "e2e/shellcode/shells/expect-command-output.ts",
    "chars": 1402,
    "preview": "import { dedent } from \"ts-dedent\"\nimport { define, ScriptLine } from \"./types.js\"\n\nexport type HasExpectCommandOutput ="
  },
  {
    "path": "e2e/shellcode/shells/output-contains.ts",
    "chars": 897,
    "preview": "import { define, ScriptLine } from \"./types.js\"\n\nexport type HasOutputContains = {\n  scriptOutputContains(script: Script"
  },
  {
    "path": "e2e/shellcode/shells/redirect-output.ts",
    "chars": 522,
    "preview": "import { ScriptLine, define } from \"./types.js\"\n\ntype RedirectOutputOpts = { output: string }\nexport type HasRedirectOut"
  },
  {
    "path": "e2e/shellcode/shells/sub-shell.ts",
    "chars": 619,
    "preview": "import { ScriptLine, define } from \"./types.js\"\nimport quote from \"shell-escape\"\n\ntype HasInSubShell = { inSubShell: (sc"
  },
  {
    "path": "e2e/shellcode/shells/types.ts",
    "chars": 292,
    "preview": "export type Shell = {\n  escapeText(str: string): string\n  binaryName(): string\n  currentlySupported(): boolean\n  name():"
  },
  {
    "path": "e2e/shellcode/shells.ts",
    "chars": 2611,
    "preview": "import { cmdCall } from \"./shells/cmdCall.js\"\nimport { cmdEnv } from \"./shells/cmdEnv.js\"\nimport { cmdExpectCommandOutpu"
  },
  {
    "path": "e2e/shellcode/test-bin-dir.ts",
    "chars": 246,
    "preview": "import { mkdirSync } from \"node:fs\"\nimport path from \"node:path\"\nimport testTmpDir from \"./test-tmp-dir.js\"\n\nexport defa"
  },
  {
    "path": "e2e/shellcode/test-cwd.ts",
    "chars": 243,
    "preview": "import { mkdirSync } from \"node:fs\"\nimport path from \"node:path\"\nimport testTmpDir from \"./test-tmp-dir.js\"\n\nexport defa"
  },
  {
    "path": "e2e/shellcode/test-node-version.ts",
    "chars": 426,
    "preview": "import { HasCall } from \"./shells/cmdCall.js\"\nimport { ScriptLine } from \"./shells/types.js\"\nimport { HasExpectCommandOu"
  },
  {
    "path": "e2e/shellcode/test-tmp-dir.ts",
    "chars": 412,
    "preview": "import { mkdirSync } from \"node:fs\"\nimport { tmpdir } from \"node:os\"\nimport { join } from \"node:path\"\n\nexport default fu"
  },
  {
    "path": "e2e/system-node.test.ts",
    "chars": 1949,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, WinCmd, Zsh } from \"./shellcode/shells.j"
  },
  {
    "path": "e2e/uninstall.test.ts",
    "chars": 864,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, Zsh } from \"./shellcode/shells.js\"\nimpor"
  },
  {
    "path": "e2e/use-on-cd.test.ts",
    "chars": 3127,
    "preview": "import { writeFile, mkdir } from \"node:fs/promises\"\nimport { join } from \"node:path\"\nimport { script } from \"./shellcode"
  },
  {
    "path": "e2e/windows-scoop.test.ts",
    "chars": 1031,
    "preview": "import { script } from \"./shellcode/script.js\"\nimport { Bash, Fish, PowerShell, WinCmd, Zsh } from \"./shellcode/shells.j"
  },
  {
    "path": "fnm-manifest.rc",
    "chars": 51,
    "preview": "#define RT_MANIFEST 24\n1 RT_MANIFEST \"fnm.manifest\""
  },
  {
    "path": "fnm.manifest",
    "chars": 378,
    "preview": "<?xml version='1.0' encoding='utf-8' standalone='yes'?>\n<assembly\n    xmlns=\"urn:schemas-microsoft-com:asm.v1\"\n    manif"
  },
  {
    "path": "jest.config.cjs",
    "chars": 738,
    "preview": "/** @type {import('ts-jest').JestConfigWithTsJest} */\nmodule.exports = {\n  preset: \"ts-jest/presets/default-esm\",\n  glob"
  },
  {
    "path": "jest.global-setup.js",
    "chars": 110,
    "preview": "import { server } from \"./tests/proxy-server/index.mjs\"\n\nexport default function () {\n  server.listen(8080)\n}\n"
  },
  {
    "path": "jest.global-teardown.js",
    "chars": 99,
    "preview": "import { server } from \"./tests/proxy-server/index.mjs\"\n\nexport default () => {\n  server.close()\n}\n"
  },
  {
    "path": "package.json",
    "chars": 1382,
    "preview": "{\n  \"name\": \"fnm\",\n  \"version\": \"1.39.0\",\n  \"private\": true,\n  \"repository\": \"git@github.com:Schniz/fnm.git\",\n  \"author\""
  },
  {
    "path": "renovate.json",
    "chars": 987,
    "preview": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\"config:base\"],\n  \"labels\": [\"PR: Depe"
  },
  {
    "path": "rust-toolchain.toml",
    "chars": 64,
    "preview": "[toolchain]\nchannel = \"1.88\"\ncomponents = [\"rustfmt\", \"clippy\"]\n"
  },
  {
    "path": "site/package.json",
    "chars": 221,
    "preview": "{\n  \"name\": \"fnm\",\n  \"version\": \"1.0.0\",\n  \"main\": \"index.js\",\n  \"author\": \"Gal Schlezinger\",\n  \"license\": \"MIT\",\n  \"scr"
  },
  {
    "path": "site/vercel.json",
    "chars": 443,
    "preview": "{\n  \"$schema\": \"https://openapi.vercel.sh/vercel.json\",\n  \"github\": {\n    \"silent\": true\n  },\n  \"redirects\": [\n    { \"so"
  },
  {
    "path": "src/alias.rs",
    "chars": 2401,
    "preview": "use crate::config::FnmConfig;\nuse crate::fs::{remove_symlink_dir, shallow_read_symlink, symlink_dir};\nuse crate::system_"
  },
  {
    "path": "src/arch.rs",
    "chars": 2515,
    "preview": "use crate::version::Version;\n\n#[derive(Clone, Copy, PartialEq, Eq, Debug)]\npub enum Arch {\n    X86,\n    X64,\n    X64Musl"
  },
  {
    "path": "src/archive/extract.rs",
    "chars": 970,
    "preview": "use std::error::Error as StdError;\nuse std::path::Path;\n\n#[derive(Debug)]\npub enum Error {\n    IoError(std::io::Error),\n"
  },
  {
    "path": "src/archive/mod.rs",
    "chars": 1257,
    "preview": "pub mod extract;\npub mod tar;\npub mod zip;\n\nuse std::io::Read;\nuse std::path::Path;\n\npub use self::extract::{Error, Extr"
  },
  {
    "path": "src/archive/tar.rs",
    "chars": 800,
    "preview": "use super::{extract::Error, Extract};\nuse std::{io::Read, path::Path};\n\npub enum Tar<R: Read> {\n    /// Tar archive with"
  },
  {
    "path": "src/archive/zip.rs",
    "chars": 2942,
    "preview": "use super::extract::{Error, Extract};\nuse log::debug;\nuse std::fs;\nuse std::io::{self, Read};\nuse std::path::Path;\nuse t"
  },
  {
    "path": "src/choose_version_for_user_input.rs",
    "chars": 2888,
    "preview": "use crate::config::FnmConfig;\nuse crate::fs;\nuse crate::installed_versions;\nuse crate::system_version;\nuse crate::user_v"
  },
  {
    "path": "src/cli.rs",
    "chars": 3742,
    "preview": "use crate::commands;\nuse crate::commands::command::Command;\nuse crate::config::FnmConfig;\nuse clap::Parser;\n\n#[derive(cl"
  },
  {
    "path": "src/commands/alias.rs",
    "chars": 1359,
    "preview": "use super::command::Command;\nuse crate::alias::create_alias;\nuse crate::choose_version_for_user_input::{\n    choose_vers"
  },
  {
    "path": "src/commands/command.rs",
    "chars": 591,
    "preview": "use crate::config::FnmConfig;\nuse crate::outln;\nuse colored::Colorize;\n\npub trait Command: Sized {\n    type Error: std::"
  },
  {
    "path": "src/commands/completions.rs",
    "chars": 1636,
    "preview": "use super::command::Command;\nuse crate::config::FnmConfig;\nuse crate::shell::{infer_shell, Shell};\nuse crate::{cli::Cli,"
  },
  {
    "path": "src/commands/current.rs",
    "chars": 495,
    "preview": "use super::command::Command;\nuse crate::config::FnmConfig;\nuse crate::current_version::{current_version, Error};\n\n#[deri"
  },
  {
    "path": "src/commands/default.rs",
    "chars": 972,
    "preview": "use super::alias::Alias;\nuse super::command::Command;\nuse crate::alias::get_alias_by_name;\nuse crate::config::FnmConfig;"
  },
  {
    "path": "src/commands/env.rs",
    "chars": 6416,
    "preview": "use super::command::Command;\nuse super::r#use::Use;\nuse crate::config::FnmConfig;\nuse crate::fs::symlink_dir;\nuse crate:"
  },
  {
    "path": "src/commands/exec.rs",
    "chars": 4687,
    "preview": "use super::command::Command as Cmd;\nuse crate::choose_version_for_user_input::{\n    choose_version_for_user_input, Error"
  },
  {
    "path": "src/commands/install.rs",
    "chars": 10744,
    "preview": "use super::command::Command;\nuse super::r#use::Use;\nuse crate::alias::create_alias;\nuse crate::arch::get_safe_arch;\nuse "
  },
  {
    "path": "src/commands/ls_local.rs",
    "chars": 2445,
    "preview": "use crate::alias::{list_aliases, StoredAlias};\nuse crate::config::FnmConfig;\nuse crate::current_version::current_version"
  },
  {
    "path": "src/commands/ls_remote.rs",
    "chars": 3159,
    "preview": "use crate::config::FnmConfig;\nuse crate::remote_node_index;\nuse crate::user_version::UserVersion;\n\nuse colored::Colorize"
  },
  {
    "path": "src/commands/mod.rs",
    "chars": 219,
    "preview": "pub mod alias;\npub mod command;\npub mod completions;\npub mod current;\npub mod default;\npub mod env;\npub mod exec;\npub mo"
  },
  {
    "path": "src/commands/unalias.rs",
    "chars": 1168,
    "preview": "use super::command::Command;\nuse crate::fs::remove_symlink_dir;\nuse crate::user_version::UserVersion;\nuse crate::version"
  },
  {
    "path": "src/commands/uninstall.rs",
    "chars": 3874,
    "preview": "use super::command::Command;\nuse crate::config::FnmConfig;\nuse crate::fs::remove_symlink_dir;\nuse crate::installed_versi"
  },
  {
    "path": "src/commands/use.rs",
    "chars": 9626,
    "preview": "use super::command::Command;\nuse super::install::Install;\nuse crate::current_version::current_version;\nuse crate::fs;\nus"
  },
  {
    "path": "src/config.rs",
    "chars": 5409,
    "preview": "use crate::arch::Arch;\nuse crate::directories::Directories;\nuse crate::log_level::LogLevel;\nuse crate::path_ext::PathExt"
  },
  {
    "path": "src/current_version.rs",
    "chars": 1310,
    "preview": "use thiserror::Error;\n\nuse crate::config::FnmConfig;\nuse crate::system_version;\nuse crate::version::Version;\n\npub fn cur"
  },
  {
    "path": "src/default_version.rs",
    "chars": 417,
    "preview": "use crate::config::FnmConfig;\nuse crate::version::Version;\nuse std::str::FromStr;\n\npub fn find_default_version(config: &"
  },
  {
    "path": "src/directories.rs",
    "chars": 2207,
    "preview": "use etcetera::BaseStrategy;\nuse std::path::PathBuf;\n\nuse crate::path_ext::PathExt;\n\nfn xdg_dir(env: &str) -> Option<Path"
  },
  {
    "path": "src/directory_portal.rs",
    "chars": 2315,
    "preview": "use log::debug;\nuse std::path::Path;\nuse tempfile::TempDir;\n\n/// A \"work-in-progress\" directory, which will \"teleport\" i"
  },
  {
    "path": "src/downloader.rs",
    "chars": 5591,
    "preview": "use crate::arch::Arch;\nuse crate::archive::{Archive, Error as ExtractError};\nuse crate::directory_portal::DirectoryPorta"
  },
  {
    "path": "src/fs.rs",
    "chars": 738,
    "preview": "use std::path::Path;\n\n#[cfg(unix)]\npub fn symlink_dir<P: AsRef<Path>, U: AsRef<Path>>(from: P, to: U) -> std::io::Result"
  },
  {
    "path": "src/http.rs",
    "chars": 696,
    "preview": "//! This module is an adapter for HTTP related operations.\n//! In the future, if we want to migrate to a different HTTP "
  },
  {
    "path": "src/installed_versions.rs",
    "chars": 1051,
    "preview": "use crate::version::Version;\nuse std::path::Path;\nuse thiserror::Error;\n\npub fn list<P: AsRef<Path>>(installations_dir: "
  },
  {
    "path": "src/log_level.rs",
    "chars": 1777,
    "preview": "use std::fmt::Display;\n\nuse clap::ValueEnum;\n\n#[derive(Debug, Default, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Valu"
  },
  {
    "path": "src/lts.rs",
    "chars": 1217,
    "preview": "use crate::remote_node_index::IndexedNodeVersion;\nuse std::fmt::Display;\n\n#[derive(Debug, PartialEq, PartialOrd, Eq, Ord"
  },
  {
    "path": "src/main.rs",
    "chars": 830,
    "preview": "#![warn(rust_2018_idioms, clippy::all, clippy::pedantic)]\n#![allow(\n    clippy::enum_variant_names,\n    clippy::large_en"
  },
  {
    "path": "src/package_json.rs",
    "chars": 416,
    "preview": "use serde::Deserialize;\n\n#[derive(Debug, Deserialize, Default)]\nstruct EnginesField {\n    node: Option<node_semver::Rang"
  },
  {
    "path": "src/path_ext.rs",
    "chars": 490,
    "preview": "use log::warn;\n\npub trait PathExt {\n    fn ensure_exists_silently(self) -> Self;\n}\n\nimpl<T: AsRef<std::path::Path>> Path"
  },
  {
    "path": "src/pretty_serde.rs",
    "chars": 1341,
    "preview": "use miette::SourceOffset;\n\n#[derive(Debug, thiserror::Error, miette::Diagnostic)]\n#[error(\"malformed json\\n{}\", self.rep"
  },
  {
    "path": "src/progress.rs",
    "chars": 3957,
    "preview": "use std::io::Read;\n\nuse indicatif::{ProgressBar, ProgressDrawTarget, ProgressStyle};\nuse reqwest::blocking::Response;\n\np"
  },
  {
    "path": "src/remote_node_index.rs",
    "chars": 3341,
    "preview": "use crate::{pretty_serde::DecodeError, version::Version};\nuse serde::Deserialize;\nuse url::Url;\n\nmod lts_status {\n    us"
  },
  {
    "path": "src/shell/bash.rs",
    "chars": 1939,
    "preview": "use crate::version_file_strategy::VersionFileStrategy;\n\nuse super::shell::Shell;\nuse indoc::formatdoc;\nuse std::path::Pa"
  },
  {
    "path": "src/shell/fish.rs",
    "chars": 1906,
    "preview": "use crate::version_file_strategy::VersionFileStrategy;\n\nuse super::shell::Shell;\nuse indoc::formatdoc;\nuse std::path::Pa"
  },
  {
    "path": "src/shell/infer/mod.rs",
    "chars": 643,
    "preview": "mod unix;\n\nmod windows;\n\n#[cfg(unix)]\npub use self::unix::infer_shell;\n#[cfg(not(unix))]\npub use self::windows::infer_sh"
  },
  {
    "path": "src/shell/infer/unix.rs",
    "chars": 3119,
    "preview": "#![cfg(unix)]\n\nuse crate::shell::Shell;\nuse log::debug;\nuse std::io::{Error, ErrorKind};\nuse thiserror::Error;\n\n#[derive"
  },
  {
    "path": "src/shell/infer/windows.rs",
    "chars": 1590,
    "preview": "#![cfg(not(unix))]\n\nuse crate::shell::Shell;\nuse log::{debug, warn};\nuse sysinfo::{ProcessRefreshKind, System, UpdateKin"
  },
  {
    "path": "src/shell/mod.rs",
    "chars": 372,
    "preview": "mod bash;\nmod fish;\nmod infer;\nmod powershell;\nmod windows_cmd;\nmod zsh;\n\n#[allow(clippy::module_inception)]\nmod shell;\n"
  },
  {
    "path": "src/shell/powershell.rs",
    "chars": 2320,
    "preview": "use crate::version_file_strategy::VersionFileStrategy;\n\nuse super::Shell;\nuse indoc::formatdoc;\nuse std::path::Path;\n\n#["
  },
  {
    "path": "src/shell/shell.rs",
    "chars": 1644,
    "preview": "use std::fmt::{Debug, Display};\nuse std::path::Path;\n\nuse clap::ValueEnum;\n\npub trait Shell: Debug {\n    fn path(&self, "
  },
  {
    "path": "src/shell/windows_cmd/cd.cmd",
    "chars": 261,
    "preview": "@echo off\ncd /d %*\nif \"%FNM_VERSION_FILE_STRATEGY%\" == \"recursive\" (\n  fnm use --silent-if-unchanged\n) else (\n  if exist"
  },
  {
    "path": "src/shell/windows_cmd/mod.rs",
    "chars": 2589,
    "preview": "use super::shell::Shell;\nuse std::path::Path;\n\n#[derive(Debug)]\npub struct WindowsCmd;\n\nimpl Shell for WindowsCmd {\n    "
  },
  {
    "path": "src/shell/windows_compat.rs",
    "chars": 715,
    "preview": "/// On Bash for Windows, we need to convert the path from a Windows-style\n/// path to a Unix-style path. This is because"
  },
  {
    "path": "src/shell/zsh.rs",
    "chars": 2265,
    "preview": "use crate::version_file_strategy::VersionFileStrategy;\n\nuse super::shell::Shell;\nuse indoc::formatdoc;\nuse std::path::Pa"
  },
  {
    "path": "src/system_info.rs",
    "chars": 807,
    "preview": "#[cfg(target_os = \"macos\")]\npub fn platform_name() -> &'static str {\n    \"darwin\"\n}\n\n#[cfg(target_os = \"linux\")]\npub fn "
  },
  {
    "path": "src/system_version.rs",
    "chars": 297,
    "preview": "use std::path::PathBuf;\n\npub fn path() -> PathBuf {\n    let path_as_string = if cfg!(windows) {\n        \"Z:/_fnm_/Nothin"
  },
  {
    "path": "src/user_version.rs",
    "chars": 5724,
    "preview": "use crate::version::Version;\nuse std::str::FromStr;\n\n#[derive(Clone, Debug)]\npub enum UserVersion {\n    OnlyMajor(u64),\n"
  },
  {
    "path": "src/user_version_reader.rs",
    "chars": 3873,
    "preview": "use crate::config::FnmConfig;\nuse crate::user_version::UserVersion;\nuse crate::version_files::{get_user_version_for_dire"
  },
  {
    "path": "src/version.rs",
    "chars": 3779,
    "preview": "use crate::alias;\nuse crate::config;\nuse crate::lts::LtsType;\nuse crate::system_version;\nuse std::str::FromStr;\n\n#[deriv"
  },
  {
    "path": "src/version_file_strategy.rs",
    "chars": 715,
    "preview": "use clap::ValueEnum;\nuse std::fmt::Display;\n\n#[derive(Debug, Clone, Copy, Default, ValueEnum)]\npub enum VersionFileStrat"
  },
  {
    "path": "src/version_files.rs",
    "chars": 3311,
    "preview": "use crate::config::FnmConfig;\nuse crate::default_version;\nuse crate::package_json::PackageJson;\nuse crate::user_version:"
  },
  {
    "path": "tests/proxy-server/index.mjs",
    "chars": 2738,
    "preview": "// @ts-check\n\nimport { createServer } from \"node:http\"\nimport path from \"node:path\"\nimport fs from \"node:fs\"\nimport cryp"
  },
  {
    "path": "tsconfig.json",
    "chars": 267,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"moduleDetection\": \"force\",\n   "
  }
]

About this extraction

This page contains the full source code of the Schniz/fnm GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 152 files (391.3 KB), approximately 111.5k tokens, and a symbol index with 389 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!