Socket
Socket
Sign inDemoInstall

is-windows-bash

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-windows-bash - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

14

index.js
fs = require('fs')
module.exports = () => {
if (process.platform.toLowerCase() === 'linux' &&
function isWindowsBash() {
if (process.platform.toLowerCase() === 'linux' &&
process.env.SHELL.toLowerCase() === '/bin/bash') {
try {
const data = fs.readFileSync('/proc/version', 'utf-8');
return data.toLowerCase().includes('microsoft');
} catch (err) {
var data = fs.readFileSync('/proc/version', 'utf-8');
return data.toLowerCase().indexOf('microsoft') > -1;
} catch (err) {
return false;

@@ -15,2 +15,4 @@ }

return false;
};
}
module.exports = isWindowsBash;
{
"name": "is-windows-bash",
"version": "1.0.0",
"version": "1.0.1",
"description": "Determines if Node is running on Windows Bash (WSL)",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc