# open-browsers

> Attempts to open the browser with a given URL. On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.

Latest version **1.4.2** (published 2025-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install open-browsers
pnpm add open-browsers
yarn add open-browsers
bun add open-browsers
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; has provenance.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2025-05-07 |
| First published | 2018-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 395.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Maintainers | wcjiang |
| Keywords | open-browsers, browsers, app, open, opn, opener, opens, launch, start, xdg, xdg, default, cmd, browser, editor, executable, exe, url, urls, arguments, args, spawn, exec, child, process, website, file |

## Links

- npm: https://www.npmjs.com/package/open-browsers
- Repository: https://github.com/react-doc/open-browsers
- Homepage: https://github.com/react-doc/open-browsers#readme
- Issues: https://github.com/react-doc/open-browsers/issues
- npm.io page: https://npm.io/package/open-browsers

## Dependencies (3)

- [open](https://npm.io/package/open.md) ^8.4.2
- [colors-cli](https://npm.io/package/colors-cli.md) ^1.0.32
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.3

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.4.2 (latest) — 2025-05-07
- 1.4.1 — 2025-02-26
- 1.4.0 — 2025-02-26
- 1.3.0 — 2023-06-23
- 1.2.2 — 2019-12-10
- 1.2.1 — 2019-12-10
- 1.2.0 — 2019-12-10
- 1.1.1 — 2018-06-09
- 1.1.0 — 2018-06-09
- 1.0.3 — 2018-06-07
- 1.0.2 — 2018-06-07
- 1.0.1 — 2018-06-07
- 1.0.0 — 2018-06-07

## README

Open Browsers
===

[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
[![CI](https://github.com/react-doc/open-browsers/actions/workflows/ci.yml/badge.svg)](https://github.com/react-doc/open-browsers/actions/workflows/ci.yml)
[![npm version](https://img.shields.io/npm/v/open-browsers.svg)](https://www.npmjs.com/package/open-browsers)
[![NPM Downloads](https://img.shields.io/npm/dm/open-browsers.svg?style=flat&label=)](https://www.npmjs.com/package/open-browsers)

Attempts to open the browser with a given URL.
On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
Otherwise, falls back to [open](https://github.com/sindresorhus/open) behavior. `open-browsers` form [react-dev-utils](https://github.com/facebook/create-react-app/blob/b8ff97be72c02128c0917437d98e1b672a25ceb4/packages/react-dev-utils/openBrowser.js).

### Install

```bash
npm install open-browsers --save-dev
```

### Usage

> openBrowsers(url: string): boolean 

```js
var openBrowsers = require('open-browsers');
if (openBrowsers('http://localhost:3000')) {
  console.log('The browser tab has been opened!');
}
```

## Contributors

As always, thanks to our amazing contributors!

<!--GAMFC--><!---->

<a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
<a href="https://github.com/tomglynch" title="Tom Lynch"><img src="https://avatars.githubusercontent.com/u/17879963?v=4" width="42;" alt="Tom Lynch"/></a>
<a href="https://github.com/kyriiherman" title="kyriiherman"><img src="https://avatars.githubusercontent.com/u/9069967?v=4" width="42;" alt="kyriiherman"/></a><!--GAMFC-END-->

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).

### License

`open-browsers` is open source software licensed as MIT.

---
_Source: https://npm.io/package/open-browsers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
