default-shell
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.0 • Public • Published

    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'

    Install

    npm i default-shell

    DownloadsWeekly Downloads

    48,792

    Version

    2.2.0

    License

    MIT

    Unpacked Size

    3.53 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus