Get the user's default shell
npm install default-shellimportdefaultShellfrom'default-shell';// macOSconsole.log(defaultShell);//=> '/bin/zsh'// Windowsconsole.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/zsh'