Skip to content

Instantly share code, notes, and snippets.

@xcoderzach
Created October 7, 2014 22:44
Show Gist options
  • Save xcoderzach/5706c0683258b00b3d20 to your computer and use it in GitHub Desktop.
Save xcoderzach/5706c0683258b00b3d20 to your computer and use it in GitHub Desktop.
var exec = require('child_process').exec
var browsers = { chrome: 'Google\\ Chrome.app', firefox: 'Firefox.app', safari: 'Safari.app' }
function openInBrowser(browser) {
exec("open -a " + browsers[browser])
}
openInBrowser('safari')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment