package
Get the user's default shell
npm install default-shellGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
3.4 kB
Includes dependencies.
Get the user's default shell
npm install default-shellimport defaultShell from 'default-shell';
// macOS
console.log(defaultShell);
//=> '/bin/bash'
// Windows
console.log(defaultShell);
//=> 'C:\\WINDOWS\\system32\\cmd.exe'There is also a method that gets the correct default shell even if it changes at runtime:
import {detectDefaultShell} from 'default-shell';
console.log(detectDefaultShell());
//=> '/bin/bash'