is-wsl

Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)

MIT 9 个版本
安装
npm install is-wsl
yarn add is-wsl
pnpm add is-wsl
bun add is-wsl
README

is-wsl

Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)

Can be useful if you need to work around unimplemented or buggy features in WSL. Supports both WSL 1 and WSL 2.

Install

npm install is-wsl

Usage

import isWsl from 'is-wsl';

// When running inside Windows Subsystem for Linux
console.log(isWsl);
//=> true
版本列表
3.1.1 2026-02-15
3.1.0 2023-09-25
3.0.0 2023-08-08
2.2.0 2020-05-03
2.1.1 2019-09-23
2.1.0 2019-06-23
2.0.0 2019-04-23
1.1.0 2017-04-17
1.0.0 2017-04-16