From e3e3f0ef1142ad150f62a0ff16f4e8d97c47c055 Mon Sep 17 00:00:00 2001 From: Reinhart Previano Koentjoro Date: Fri, 3 Nov 2023 01:24:04 +0700 Subject: [PATCH] common/*: add ps-nvm commands (#11298) * common/*: add ps-nvm commands --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Co-authored-by: Magrid --- pages/common/get-nodeinstalllocation.md | 9 ++++++++ pages/common/get-nodeversions.md | 17 +++++++++++++++ pages/common/install-nodeversion.md | 25 +++++++++++++++++++++ pages/common/ps-nvm.md | 29 +++++++++++++++++++++++++ pages/common/remove-nodeversion.md | 21 ++++++++++++++++++ pages/common/set-nodeinstalllocation.md | 9 ++++++++ pages/common/set-nodeversion.md | 21 ++++++++++++++++++ 7 files changed, 131 insertions(+) create mode 100644 pages/common/get-nodeinstalllocation.md create mode 100644 pages/common/get-nodeversions.md create mode 100644 pages/common/install-nodeversion.md create mode 100644 pages/common/ps-nvm.md create mode 100644 pages/common/remove-nodeversion.md create mode 100644 pages/common/set-nodeinstalllocation.md create mode 100644 pages/common/set-nodeversion.md diff --git a/pages/common/get-nodeinstalllocation.md b/pages/common/get-nodeinstalllocation.md new file mode 100644 index 000000000..6de6277a0 --- /dev/null +++ b/pages/common/get-nodeinstalllocation.md @@ -0,0 +1,9 @@ +# Get-NodeInstallLocation + +> Get the current Node.js installation directory for `ps-nvm`. +> Part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- Get the current Node.js installation directory: + +`Get-NodeInstallLocation` diff --git a/pages/common/get-nodeversions.md b/pages/common/get-nodeversions.md new file mode 100644 index 000000000..51559f29a --- /dev/null +++ b/pages/common/get-nodeversions.md @@ -0,0 +1,17 @@ +# Get-NodeVersions + +> List installed and available Node.js versions for `ps-nvm`. +> Part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- List all installed Node.js versions: + +`Get-NodeVersions` + +- List all available Node.js versions: + +`Get-NodeVersions -Remote` + +- List all available Node.js 20.x versions: + +`Get-NodeVersions -Remote -Filter ">=20.0.0 <21.0.0"` diff --git a/pages/common/install-nodeversion.md b/pages/common/install-nodeversion.md new file mode 100644 index 000000000..115b55d91 --- /dev/null +++ b/pages/common/install-nodeversion.md @@ -0,0 +1,25 @@ +# Install-NodeVersion + +> Install Node.js runtime versions for `ps-nvm`. +> This command is part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- Install a specific Node.js version: + +`Install-NodeVersion {{node_version}}` + +- Install multiple Node.js versions: + +`Install-NodeVersion {{node_version1 , node_version2 , ...}}` + +- Install latest available version of Node.js 20: + +`Install-NodeVersion ^20` + +- Install the x86 (x86 32-bit) / x64 (x86 64-bit) / arm64 (ARM 64-bit) version of Node.js: + +`Install-NodeVersion {{node_version}} -Architecture {{x86|x64|arm64}}` + +- Use a HTTP proxy to download Node.js: + +`Install-NodeVersion {{node-version}} -Proxy {{http://example.com}}` diff --git a/pages/common/ps-nvm.md b/pages/common/ps-nvm.md new file mode 100644 index 000000000..8d16e8eda --- /dev/null +++ b/pages/common/ps-nvm.md @@ -0,0 +1,29 @@ +# ps-nvm + +> PowerShell-based utility to manage multiple Node.js versions, inspired by `nvm`. +> This tool provides multiple commands that all can only be run through PowerShell. +> More information: . + +- View documentation for `Get-NodeInstallLocation`, a tool to get the current Node.js install location: + +`tldr get-nodeinstalllocation` + +- View documentation for `Get-NodeVersions`, a tool to list all available and currently-installed Node.js versions: + +`tldr get-nodeversions` + +- View documentation for `Install-NodeVersion`, a tool to install Node.js runtime versions: + +`tldr get-nodeversion` + +- View documentation for `Remove-NodeVersion`, a tool to uninstall an existing Node.js version: + +`tldr remove-nodeversion` + +- View documentation for `Set-NodeInstallLocation`, a tool to set the Node.js install location: + +`tldr set-nodeinstalllocation` + +- View documentation for `Set-NodeVersion`, a tool to set the default version of Node.js: + +`tldr set-nodeversion` diff --git a/pages/common/remove-nodeversion.md b/pages/common/remove-nodeversion.md new file mode 100644 index 000000000..7c8f4f6f5 --- /dev/null +++ b/pages/common/remove-nodeversion.md @@ -0,0 +1,21 @@ +# Remove-NodeVersion + +> Uninstall Node.js runtime versions for `ps-nvm`. +> This command is part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- Uninstall a given Node.js version: + +`Remove-NodeVersion {{node_version}}` + +- Uninstall multiple Node.js versions: + +`Remove-NodeVersion {{node_version1 , node_version2 , ...}}` + +- Uninstall all currently-installed versions of Node.js 20.x: + +`Get-NodeVersions -Filter ">=20.0.0 <21.0.0" | Remove-NodeVersion` + +- Uninstall all currently-installed versions of Node.js: + +`Get-NodeVersions | Remove-NodeVersion` diff --git a/pages/common/set-nodeinstalllocation.md b/pages/common/set-nodeinstalllocation.md new file mode 100644 index 000000000..d29438e19 --- /dev/null +++ b/pages/common/set-nodeinstalllocation.md @@ -0,0 +1,9 @@ +# Set-NodeInstallLocation + +> Set the default Node.js installation directory for `ps-nvm`. +> This command is part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- Change the Node.js install location to a specified directory (`ps-nvm` will create a new `.nvm` subdirectory to install them): + +`Set-NodeInstallLocation {{path/to/directory}}` diff --git a/pages/common/set-nodeversion.md b/pages/common/set-nodeversion.md new file mode 100644 index 000000000..5d0b65010 --- /dev/null +++ b/pages/common/set-nodeversion.md @@ -0,0 +1,21 @@ +# Set-NodeVersion + +> Set the default Node.js version for `ps-nvm`. +> Part of `ps-nvm` and can only be run under PowerShell. +> More information: . + +- Use a specific version of Node.js in the current PowerShell session: + +`Set-NodeVersion {{node_version}}` + +- Use the latest installed Node.js version 20.x: + +`Set-NodeVersion ^20` + +- Set the default Node.js version for the current user (only applies to future PowerShell sessions): + +`Set-NodeVersion {{node_version}} -Persist User` + +- Set the default Node.js version for all users (must be run as Administrator/root and only applies to future PowerShell sessions): + +`Set-NodeVersion {{node_version}} -Persist Machine`