提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
wuguanghui 54c65dd92a 吴光慧11.4学习笔记 3 weeks ago
..
index.d.ts 吴光慧11.3学习笔记 3 weeks ago
index.js 吴光慧11.3学习笔记 3 weeks ago
license 吴光慧11.3学习笔记 3 weeks ago
package.json 吴光慧11.3学习笔记 3 weeks ago
readme.md 吴光慧11.3学习笔记 3 weeks ago

readme.md

wsl-utils

Utilities for working with Windows Subsystem for Linux (WSL)

Install

npm install wsl-utils

Usage

import {isWsl, powerShellPathFromWsl} from 'wsl-utils';

// Check if running in WSL
console.log('Is WSL:', isWsl);

// Get PowerShell path from WSL
console.log('PowerShell path:', await powerShellPathFromWsl());
//=> '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'

API

isWsl

Type: boolean

Check if the current environment is Windows Subsystem for Linux (WSL).

powerShellPathFromWsl()

Returns: Promise<string>

Get the PowerShell executable path in WSL environment.

powerShellPath()

Returns: Promise<string>

Get the PowerShell executable path for the current environment.

Returns WSL path if in WSL, otherwise returns Windows path.

wslDrivesMountPoint()

Returns: Promise<string>

Get the mount point for fixed drives in WSL.