# is-wsl

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

Latest version **3.1.1** (published 2026-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-wsl
pnpm add is-wsl
yarn add is-wsl
bun add is-wsl
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2026-02-15 |
| First published | 2017-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 198 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | check, wsl, windows, subsystem, linux, detect, bash, process, console, terminal, is |

## Links

- npm: https://www.npmjs.com/package/is-wsl
- Repository: https://github.com/sindresorhus/is-wsl
- Homepage: https://github.com/sindresorhus/is-wsl#readme
- Issues: https://github.com/sindresorhus/is-wsl/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-wsl

## Dependencies (1)

- [is-inside-container](https://npm.io/package/is-inside-container.md) ^1.0.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 3.1.1 (latest) — 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

## README

# is-wsl

> Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (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

```sh
npm install is-wsl
```

## Usage

```js
import isWsl from 'is-wsl';

// When running inside Windows Subsystem for Linux
console.log(isWsl);
//=> true
```

---
_Source: https://npm.io/package/is-wsl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
