just-launch
Launch any browser, on any OS, with a fresh session!
$ just-launch chrome https://github.com/
const browser = await launch('chrome', { uri: 'https://github.com/' })
Browsers
just-launch comes with support for those browsers:
- Chrome
- Firefox
- Safari
- Edge
- Electron
- PhantomJS
On those operating systems:
Usage
Use its CLI:
$ just-launch chrome https://github.com
Use its API:
const launch = require('just-launch')
const browser = await launch('chrome', { uri: 'https://github.com' })
browser.on('error', console.error)
launch('chrome', { uri: 'https://github.com' })
.then(browser => {
browser.on('error', console.error)
})
Installation
$ npm install [-g] just-launch
API
launch(browser, opts)
Possible browser values:
chrome
firefox
electron
phantom
safari (mac OS only)
edge (Windows only)
Options:
Returns a Browser object:
Browser#on('error', cb)
An error occurred.
Browser#on('exit', cb)
The process exited.
Browser#kill()
Kill the browser process.
CLI
$ just-launch
Usage: just-launch BROWSER URI
Related projects
License
MIT