@cjser/wsl-utils__v0_1_0
v0.1.0-cjser.2
Published
Utilities for working with Windows Subsystem for Linux (WSL)
Maintainers
Readme
wsl-utils
Utilities for working with Windows Subsystem for Linux (WSL)
Install
npm install wsl-utilsUsage
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.
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/wsl-utils
