UNPKG

detect-shell

Version:
34 lines (25 loc) 897 B
# detect-shell Detect [shells](https://en.wikipedia.org/wiki/Shell_(computing)) available on the system (based on vscode's [implementation](https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/terminal/node/terminal.ts)) [![npm](https://img.shields.io/npm/v/detect-shell?style=for-the-badge)](https://www.npmjs.com/package/detect-shell) ## Install ``` $ npm install --save detect-shell ``` ## Usage ```js 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' } ] ```