detect-shell

detect shells available on the system

Usage no npm install needed!

<script type="module">
  import detectShell from 'https://cdn.skypack.dev/detect-shell';
</script>

README

detect-shell

Detect shells available on the system (based on vscode's implementation)

npm

Install

$ npm install --save detect-shell

Usage

const {detectAvailableShells} = require('detect-shell');

detectAvailableShells().then((shells) => {
  console.log(shells);
});

// output
[
  { label: 'bash', path: '/bin/bash' },
  { label: 'csh', path: '/bin/csh' },
  { label: 'dash', path: '/bin/dash' },
  { label: 'ksh', path: '/bin/ksh' },
  { label: 'sh', path: '/bin/sh' },
  { label: 'tcsh', path: '/bin/tcsh' },
  { label: 'zsh', path: '/bin/zsh' },
  { label: 'pwsh', path: '/usr/local/bin/pwsh' }
]