https://github.com/includable/open-browser
Utility function to open the browser.
https://github.com/includable/open-browser
Last synced: 2 months ago
JSON representation
Utility function to open the browser.
- Host: GitHub
- URL: https://github.com/includable/open-browser
- Owner: includable
- Created: 2018-12-18T12:16:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-26T17:19:15.000Z (over 1 year ago)
- Last Synced: 2025-09-30T05:46:58.085Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Open browser
Very simple utility function that opens the browser, with some smartness built in:
- It uses the `BROWSER` environment variable to determine what browser to open.
- `BROWSER` can be set to a script file name ending in `.js` to call that script with the URL instead of opening the browser.
- When using Google Chrome on Mac and a tab with the same URL is already open, it will focus and reload that tab instead of opening a new tab.
## Installation
```sh
npm i @includable/open-browser
```
## Usage
```js
const openBrowser = require('@includable/open-browser')
openBrowser('https://www.includable.com/')
```