node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…

default-browser

Get the default browser

default-browser

Get the default browser (macOS and Linux)

$ npm install --save default-browser
const defaultBrowser = require('default-browser');
 
defaultBrowser().then(browser => {
    console.log(browser);
    //=> {name: 'Safari', id: 'com.apple.Safari'} 
});

MIT © Sindre Sorhus