EG/Cesium-1.132/node_modules/wsl-utils
2025-08-25 17:48:13 +08:00
..
node_modules/is-wsl 补充Cesium文件 2025-08-25 17:48:13 +08:00
index.d.ts 补充Cesium文件 2025-08-25 17:48:13 +08:00
index.js 补充Cesium文件 2025-08-25 17:48:13 +08:00
license 补充Cesium文件 2025-08-25 17:48:13 +08:00
package.json 补充Cesium文件 2025-08-25 17:48:13 +08:00
readme.md 补充Cesium文件 2025-08-25 17:48:13 +08:00

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.