default-shell

Get the user's default shell

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
default-shell
3902.2.03 years ago8 years agoMinified + gzip package size for default-shell in KB

Readme

default-shell
Get the user's default shell)

Install

npm install default-shell

Usage

import 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'