Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/is-wsl
Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)
https://github.com/sindresorhus/is-wsl
Last synced: about 11 hours ago
JSON representation
Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)
- Host: GitHub
- URL: https://github.com/sindresorhus/is-wsl
- Owner: sindresorhus
- License: mit
- Created: 2017-04-16T13:34:00.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-09-25T05:58:47.000Z (over 1 year ago)
- Last Synced: 2025-01-18T11:05:54.136Z (8 days ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 188
- Watchers: 9
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-cross-platform-nodejs - is-wsl - Detect whether current platform is WSL (Windows Subsystem for Linux). (Libraries / OS identification)
- Awesome-WSL - is-wsl for Node - Check if the current process is running inside Windows Subsystem for Linux, useful for scripting. ![github project][githublogo] (WSL Tools / 10. GUI Apps)
- awesome-nodejs - is-wsl - Detect whether current platform is WSL (Windows Subsystem for Linux). ![](https://img.shields.io/github/stars/sindresorhus/is-wsl.svg?style=social&label=Star) (Repository / OS Identification)
- awesome-starred-test - sindresorhus/is-wsl - Check if the process is running inside Windows Subsystem for Linux (Bash on Windows) (JavaScript)
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
```