{"_id":"wsl-utils","_rev":"5-e394d9742bec839109780077d38c4f0c","name":"wsl-utils","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"wsl-utils","version":"0.1.0","keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"wsl-utils@0.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/wsl-utils#readme","bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"dist":{"shasum":"8783d4df671d4d50365be2ee4c71917a0557baab","tarball":"https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz","fileCount":5,"integrity":"sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==","signatures":[{"sig":"MEQCIFCrvz7Qyr97it2moj4jJqf8ZIC+/50q3noOmH0yJKQNAiAF1EsjOEyHWaGapbdlN6O8locbrA0qK6EdJ7HtJ3hCHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5036},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"04a87271eb4e2383c1bcd2f20146693d40bdd4bb","scripts":{"test":"xo && ava && tsc index.d.ts --skipLibCheck"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/wsl-utils.git","type":"git"},"_npmVersion":"10.9.2","description":"Utilities for working with Windows Subsystem for Linux (WSL)","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","dependencies":{"is-wsl":"^3.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.0.0","ava":"^6.3.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/wsl-utils_0.1.0_1748044032698_0.9980935081165065","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"wsl-utils","version":"0.2.0","keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"wsl-utils@0.2.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/wsl-utils#readme","bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"dist":{"shasum":"d2fdda12c19349a42778ec516f3eb56b4cc2c4ce","tarball":"https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.2.0.tgz","fileCount":5,"integrity":"sha512-BEyXxKYg099YBn6A0F9lIHrELxngKiK6LrkbeMjLxJ/IJ0hCeyro0qjQcvTR+yXiG1SPkTswmgwlwDcMAz+lTA==","signatures":[{"sig":"MEYCIQCqCCimnLDgz1AH/So5Z3F6QOQeStSvIy9plMCDKpQ7UgIhAO/kZz05m/LQLTs7iHnxlgqiUHX5oC0k9muAk8QZ12ND","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6871},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"7748c9b770ff0ce903b8e53097647f90af875ac6","scripts":{"test":"xo && ava && tsc index.d.ts --skipLibCheck"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/wsl-utils.git","type":"git"},"_npmVersion":"11.6.1","description":"Utilities for working with Windows Subsystem for Linux (WSL)","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"is-wsl":"^3.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.0.0","ava":"^6.3.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/wsl-utils_0.2.0_1762886259726_0.03410946033577522","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"wsl-utils","version":"0.3.0","keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"wsl-utils@0.3.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/wsl-utils#readme","bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"dist":{"shasum":"197049b93b34b822703bf4ccde8256660651205f","tarball":"https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.0.tgz","fileCount":5,"integrity":"sha512-3sFIGLiaDP7rTO4xh3g+b3AzhYDIUGGywE/WsmqzJWDxus5aJXVnPTNC/6L+r2WzrwXqVOdD262OaO+cEyPMSQ==","signatures":[{"sig":"MEQCID44NQAvztLLNFYwRhjUQocXy80qotcdIWt750Y9HEvpAiAuOmASDMcW0jTtQtyx1J5iR/nswg3ag52/tYWsnwBKpQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9674},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"2e811dfde52fa8b44aef793a85538321df166433","scripts":{"test":"xo && ava && tsc index.d.ts --skipLibCheck"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/wsl-utils.git","type":"git"},"_npmVersion":"11.6.1","description":"Utilities for working with Windows Subsystem for Linux (WSL)","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"is-wsl":"^3.1.0","powershell-utils":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/wsl-utils_0.3.0_1763194504780_0.7132711681843236","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"wsl-utils","version":"0.3.1","keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"wsl-utils@0.3.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/wsl-utils#readme","bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"dist":{"shasum":"9479836ddf03be267aad3abfc3cb1f6e0c9f1ed1","tarball":"https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz","fileCount":6,"integrity":"sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==","signatures":[{"sig":"MEUCIDobiGg9UYNuSqIDnlJC6Cv/oMgp6I1ZbkmGnEhtgMbWAiEA6GzrCXFKbkeJSqsxRlxoAUE3dor/PXM94xceBCy+M1I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10178},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"5320748a16e6b149741cd0399a482f77159935c2","scripts":{"test":"xo && ava && tsc index.d.ts --skipLibCheck"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/wsl-utils.git","type":"git"},"_npmVersion":"11.6.1","description":"Utilities for working with Windows Subsystem for Linux (WSL)","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"is-wsl":"^3.1.0","powershell-utils":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/wsl-utils_0.3.1_1767359523939_0.03591857818349675","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"wsl-utils","version":"0.4.0","description":"Utilities for working with Windows Subsystem for Linux (WSL)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/wsl-utils.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsc index.d.ts --skipLibCheck"},"keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"dependencies":{"is-wsl":"^3.1.0","powershell-utils":"^0.1.0"},"devDependencies":{"ava":"^6.4.1","typescript":"^5.9.3","xo":"^1.2.3"},"gitHead":"77c4e507eabb0c21bed0589257fb1f9e48de3a12","types":"./index.d.ts","_id":"wsl-utils@0.4.0","bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"homepage":"https://github.com/sindresorhus/wsl-utils#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-9YmF+2sFEd+T7TkwlmE337F0IVzfDvDknhtpBQxxXzEOfgPphGlFYpyx0cTuCIFj8/p+sqwBYAeGxOMNSzPPDA==","shasum":"58334dda6892a81d7acc80417cd6f141a8074958","tarball":"https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.4.0.tgz","fileCount":6,"unpackedSize":16484,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDpAX0saobbz57xXcZ1MPlEpaI1ccIQkuwsp3f+4Sc1gAIgRKXsnuk3+pg0m40gvBPDXsxyYjzaVMCYkoFP74WFgnE="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wsl-utils_0.4.0_1769323865640_0.32971385823480515"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-23T23:47:12.697Z","modified":"2026-01-25T06:51:05.891Z","0.1.0":"2025-05-23T23:47:12.897Z","0.2.0":"2025-11-11T18:37:39.917Z","0.3.0":"2025-11-15T08:15:04.989Z","0.3.1":"2026-01-02T13:12:04.090Z","0.4.0":"2026-01-25T06:51:05.778Z"},"bugs":{"url":"https://github.com/sindresorhus/wsl-utils/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/wsl-utils#readme","keywords":["wsl","windows","subsystem","linux","powershell","mount","utilities"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/wsl-utils.git"},"description":"Utilities for working with Windows Subsystem for Linux (WSL)","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"readme":"# wsl-utils\n\n> Utilities for working with [Windows Subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)\n\n## Install\n\n```sh\nnpm install wsl-utils\n```\n\n## Usage\n\n```js\nimport {isWsl, powerShellPathFromWsl} from 'wsl-utils';\n\n// Check if running in WSL\nconsole.log('Is WSL:', isWsl);\n\n// Get PowerShell path from WSL\nconsole.log('PowerShell path:', await powerShellPathFromWsl());\n//=> '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'\n```\n\n## API\n\n### isWsl\n\nType: `boolean`\n\nCheck if the current environment is Windows Subsystem for Linux (WSL).\n\n### powerShellPathFromWsl()\n\nReturns: `Promise`\n\nGet the PowerShell executable path in WSL environment.\n\n### powerShellPath()\n\nReturns: `Promise`\n\nGet the PowerShell executable path for the current environment.\n\nReturns WSL path if in WSL, otherwise returns Windows path.\n\n### canAccessPowerShell()\n\nReturns: `Promise`\n\nCheck if PowerShell is accessible in the current environment.\n\nThis is useful to determine whether Windows integration features can be used. In sandboxed WSL environments or systems where PowerShell is not accessible, this will return `false`.\n\n```js\nimport {canAccessPowerShell} from 'wsl-utils';\n\nif (await canAccessPowerShell()) {\n\t// Use Windows integration features\n\tconsole.log('PowerShell is accessible');\n} else {\n\t// Fall back to Linux-native behavior\n\tconsole.log('PowerShell is not accessible');\n}\n```\n\n### wslDefaultBrowser()\n\nReturns: `Promise`\n\nGet the default browser in WSL.\n\nReturns a promise that resolves to the [ProgID](https://setuserfta.com/guide-to-understanding-progids-and-file-type-associations/) of the default browser (e.g., `'ChromeHTML'`, `'FirefoxURL'`).\n\n```js\nimport {wslDefaultBrowser} from 'wsl-utils';\n\nconst progId = await wslDefaultBrowser();\n//=> 'ChromeHTML'\n```\n\n### wslDrivesMountPoint()\n\nReturns: `Promise`\n\nGet the mount point for fixed drives in WSL.\n\n### convertWslPathToWindows(path)\n\nReturns: `Promise`\n\nConvert a WSL Linux path to a Windows-accessible path.\n\nURLs (strings starting with a protocol like `https://`) are returned unchanged.\n\n```js\nimport {convertWslPathToWindows} from 'wsl-utils';\n\n// Convert a Linux path\nconst windowsPath = await convertWslPathToWindows('/home/user/file.html');\n//=> '\\\\wsl.localhost\\Ubuntu\\home\\user\\file.html'\n\n// URLs are not converted\nconst url = await convertWslPathToWindows('https://example.com');\n//=> 'https://example.com'\n```\n\n#### path\n\nType: `string`\n\nThe WSL path to convert (e.g., `/home/user/file.html`).\n\n### convertWslPathToWindows(paths)\n\nReturns: `Promise`\n\nConvert multiple WSL Linux paths to Windows-accessible paths.\n\n```js\nimport {convertWslPathToWindows} from 'wsl-utils';\n\nconst windowsPaths = await convertWslPathToWindows([\n\t'/home/user/file.html',\n\t'/mnt/c/Users/file.txt',\n\t'https://example.com'\n]);\n//=> ['\\\\wsl.localhost\\Ubuntu\\home\\user\\file.html', 'C:\\Users\\file.txt', 'https://example.com']\n```\n\n#### paths\n\nType: `string[]`\n\nThe WSL paths to convert.\n\n### isUncPath(path)\n\nReturns: `boolean`\n\nCheck if a Windows path is a UNC path (e.g., `\\\\wsl.localhost\\...` or `\\\\wsl$\\...`).\n\nUNC paths indicate the file resides on the WSL Linux filesystem rather than a Windows drive.\n\n```js\nimport {isUncPath} from 'wsl-utils';\n\nisUncPath('\\\\\\\\wsl.localhost\\\\Ubuntu\\\\home\\\\user');\n//=> true\n\nisUncPath('C:\\\\Users\\\\file.txt');\n//=> false\n```\n\n#### path\n\nType: `string`\n\nThe Windows path to check.\n\n### isPathOnWindowsFilesystem(path)\n\nReturns: `Promise`\n\nCheck if a WSL path maps to the Windows filesystem.\n\nThis converts the path and checks if it's on a Windows drive (e.g., `/mnt/c/...` → `C:\\...`) rather than the Linux filesystem (e.g., `/home/...` → `\\\\wsl$\\...`).\n\n```js\nimport {isPathOnWindowsFilesystem} from 'wsl-utils';\n\nawait isPathOnWindowsFilesystem('/mnt/c/Users/file.txt');\n//=> true\n\nawait isPathOnWindowsFilesystem('/home/user/file.txt');\n//=> false\n```\n\n#### path\n\nType: `string`\n\nThe WSL path to check.\n\n### convertWindowsPathToWsl(path)\n\nReturns: `Promise`\n\nConvert a Windows path to a WSL Linux path.\n\n```js\nimport {convertWindowsPathToWsl} from 'wsl-utils';\n\nconst wslPath = await convertWindowsPathToWsl('C:\\\\Users\\\\file.txt');\n//=> '/mnt/c/Users/file.txt'\n```\n\n#### path\n\nType: `string`\n\nThe Windows path to convert.\n\n### convertWindowsPathToWsl(paths)\n\nReturns: `Promise`\n\nConvert multiple Windows paths to WSL Linux paths.\n\n```js\nimport {convertWindowsPathToWsl} from 'wsl-utils';\n\nconst wslPaths = await convertWindowsPathToWsl([\n\t'C:\\\\Users\\\\file.txt',\n\t'D:\\\\Projects\\\\app'\n]);\n//=> ['/mnt/c/Users/file.txt', '/mnt/d/Projects/app']\n```\n\n#### paths\n\nType: `string[]`\n\nThe Windows paths to convert.\n","readmeFilename":"readme.md"}