# better-opn

> A better opn. Reuse the same tab on Chrome for 👨‍💻.

Latest version **3.0.2** (published 2022-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install better-opn
pnpm add better-opn
yarn add better-opn
bun add better-opn
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2022-01-21 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 1 |
| Unpacked size | 280.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Lin |
| Maintainers | exiasr |
| Keywords | opn, open, opener, launch, browser |

## Links

- npm: https://www.npmjs.com/package/better-opn
- Repository: https://github.com/ExiaSR/better-opn
- Homepage: https://github.com/ExiaSR/better-opn#readme
- Issues: https://github.com/ExiaSR/better-opn/issues
- npm.io page: https://npm.io/package/better-opn

## Dependencies (1)

- [open](https://npm.io/package/open.md) ^8.0.4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2022-01-21
- 3.0.1 — 2021-11-05
- 3.0.0 — 2021-03-30
- 2.1.1 — 2020-10-21
- 2.1.0 — 2020-10-19
- 2.0.0 — 2020-04-06
- 1.0.0 — 2019-09-06
- 1.0.0-rc.2 — 2019-09-06
- 1.0.0-rc.1 — 2019-09-06
- 0.1.4 — 2018-12-11
- 0.1.3 — 2018-12-11
- 0.1.2 — 2018-12-11
- 0.1.1 — 2018-12-02
- 0.1.0 — 2018-07-25
- 0.1.0-rc.1 — 2018-07-25

## README

# better-opn

> A better opn. Reuse the same tab on Chrome for 👨‍💻. Inspire by [create-react-app](https://github.com/facebook/create-react-app)

## Install

> `$ yarn add better-opn`

> `$ npm install better-opn`


## Usage

If you wish to overwrite the default browser, override `BROWSER` environment variable to your desired browser name (name is platform dependent).

```js
const opn = require('better-opn');

opn('http://localhost:3000');
```

### Reuse tab by match host

In case your app can navigate to another pathnames and still want to reuse opened tab, set environment variable `OPEN_MATCH_HOST_ONLY=true` can tell this program to find reusable tab by only match the host part of your URL.

```js
process.env.OPEN_MATCH_HOST_ONLY = 'true';

opn('http://localhost:3000/foo/bar'); // This will reuse any tab with URL starting with http://localhost:3000/
```

## Author

- [Michael Lin](https://michaellin.me)

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