Download Fore_End/cpcn2/node_modules/is-wsl/index.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 558 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/is-wsl/index.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/is-wsl/index.js
-
curl -L -o index.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/is-wsl/index.js
558 Bytes
| ; | |
| const os = require('os'); | |
| const fs = require('fs'); | |
| const isDocker = require('is-docker'); | |
| const isWsl = () => { | |
| if (process.platform !== 'linux') { | |
| return false; | |
| } | |
| if (os.release().toLowerCase().includes('microsoft')) { | |
| if (isDocker()) { | |
| return false; | |
| } | |
| return true; | |
| } | |
| try { | |
| return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ? | |
| !isDocker() : false; | |
| } catch (_) { | |
| return false; | |
| } | |
| }; | |
| if (process.env.__IS_WSL_TEST__) { | |
| module.exports = isWsl; | |
| } else { | |
| module.exports = isWsl(); | |
| } | |