An open API service indexing awesome lists of open source software.

https://github.com/gustavorizzon/psnm

Lightweight tool for managing Node.js versions via PowerShell.
https://github.com/gustavorizzon/psnm

javascript nodejs nvm powershell version windows

Last synced: 2 months ago
JSON representation

Lightweight tool for managing Node.js versions via PowerShell.

Awesome Lists containing this project

README

          

# PowerShell Node Manager

PSNM is a lightweight Node.js version manager built entirely in PowerShell, designed for Windows environments where traditional tools are unavailable or restricted.

## Why PSNM?

Managing multiple Node.js versions on Windows can be painful - especially in corporate environments.

Common problems:

- nvm or fnm not approved
- No access to package managers
- Manual Node.js installations
- Locked-down systems

PSNM solves this by using **only PowerShell and official Node.js binaries**.

## Key Features

- Written entirely in PowerShell
- No external dependencies
- Uses **official Node.js binaries from nodejs.org**
- No admin privileges required
- Session-based version switching
- Supports `.node-version` and `.nvmrc`
- Simple and predictable CLI

## Getting Started

To get started with PowerShell Node Manager, follow these steps:

1. Clone the repository:

```powershell
git clone https://github.com/gustavorizzon/psnm.git $HOME\.psnm
```

2. Add an entry to your PowerShell profile to create an alias for the PowerShell Simple Node Manager:

```powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
if (-not (Test-Path $profile)) { New-Item $profile -Force }
Add-Content -Path $profile -Value "Import-Module $HOME\.psnm\psnm.psm1"
```

3. Restart your PowerShell session to apply the changes made to your profile.

### Commands

| Command | Description |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `psnm use [version]` | Switches to the specified version of Node.js. If `version` is omitted, it will try to read `.node-version` and `.nvmrc` files |
| `psnm ls` | Lists all installed versions of Node.js. |
| `psnm ls-remote` | Lists all available versions of Node.js. |
| `psnm install ` | Installs the specified version of Node.js from your system |
| `psnm remove ` | Removes the specified version of Node.js from your system |
| `psnm default ` | Sets or shows the default Node.js version |