# opener

> Opens stuff, like webpages and files and executables, cross-platform

Latest version **1.5.2** (published 2020-08-29) · (WTFPL OR MIT) license · 0 weekly downloads

## Install

```sh
npm install opener
pnpm add opener
yarn add opener
bun add opener
```

Provides the command `opener`.

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2020-08-29 |
| First published | 2012-08-06 |
| Weekly downloads | 0 |
| License | (WTFPL OR MIT) |
| TypeScript types | separate (@types/opener) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 311 |
| Author | Domenic Denicola |
| Maintainers | domenic |

## Links

- npm: https://www.npmjs.com/package/opener
- Repository: https://github.com/domenic/opener
- Homepage: https://github.com/domenic/opener#readme
- Issues: https://github.com/domenic/opener/issues
- npm.io page: https://npm.io/package/opener

## Recent versions

- 1.5.2 (latest) — 2020-08-29
- 1.5.1 — 2018-08-28
- 1.5.0 — 2018-08-12
- 1.4.3 — 2017-02-15
- 1.4.2 — 2016-09-10
- 1.4.1 — 2015-03-24
- 1.4.0 — 2014-08-21
- 1.3.0 — 2012-09-13
- 1.2.0 — 2012-08-24
- 1.1.0 — 2012-08-23
- 1.0.1 — 2012-08-06
- 1.0.0 — 2012-08-06

## README

# It Opens Stuff

That is, in your desktop environment. This will make *actual windows pop up*, with stuff in them:

```bash
npm install opener -g

opener http://google.com
opener ./my-file.txt
opener firefox
opener npm run lint
```

Also if you want to use it programmatically you can do that too:

```js
var opener = require("opener");

opener("http://google.com");
opener("./my-file.txt");
opener("firefox");
opener("npm run lint");
```

Plus, it returns the child process created, so you can do things like let your script exit while the window stays open:

```js
var editor = opener("documentation.odt");
editor.unref();
// These other unrefs may be necessary if your OS's opener process
// exits before the process it started is complete.
editor.stdin.unref();
editor.stdout.unref();
editor.stderr.unref();
```

## Use It for Good

Like opening the user's browser with a test harness in your package's test script:

```json
{
    "scripts": {
        "test": "opener ./test/runner.html"
    },
    "devDependencies": {
        "opener": "*"
    }
}
```

## Why

Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least [according to some person on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all three. Like Node.js. And Opener.

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