sindresorhus / is-wsl

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to have this package check if wsl1 or wsl2?

BerserkerGaruk opened this issue · comments

Is there a way to use this package and check if the current runtime is WSL1 or WSL2? I'm wondering because in WSL 1 docker has some buggy work-around in order to get working, but in WSL 2 it works closer to an actual docker install through the docker wsl preview. In this instance I'd like to be able to see if i'm running in wsl1 or wsl2 as it would allow me to act appropriately.

I'm not interested in adding separate checks in this package, but if you look at #3, you can see that you can differentiate them by the casing of os.release().