You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

wsl-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wsl-utils

Utilities for working with Windows Subsystem for Linux (WSL)

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
957K
19149780%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

wsl

FAQs

Package last updated on 23 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts