# 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 guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all
three. Like Node.js. And Opener.

# opener2 #

A clone of [opener](https://www.npmjs.com/package/opener) without the 'child_process' call included.
Single function that returns an object with the platform dependent "open"
command and the args which may be escaped depending on platform.

## Why ##

The original opener called `child_process.execFile` which did not fit my use case.
Other options like [node-open](https://www.npmjs.com/package/open) and [opn](https://www.npmjs.com/package/opn)
still create the process directly, which is awfully opinionated. Some other problems exist such as testing the
library's dependencies instead of the library itself such as ensuring the default program opened or ensuring
the process was actually created.

## Usage ##

Pass the target "file" which you want to pass to your "open" call.

```js
var childProcess = require('child_process'),
    opener = require('opener2'),
    sub = opener('http://google.com');

childProcess.spawn(sub.command, sub.args);
```

Pass the target "file" as argument to a given command.

```js
var childProcess = require('child_process'),
    opener = require('opener2'),
    sub = opener('./file.txt', 'sublime');

childProcess.exec([sub.command].concat(sub.args).join(' '));
```

Update the readme to explain my reasoning.
Update the readme to explain my reasoning.
