opener

WebJar for opener

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

opener
Last Version

Last Version

1.5.2
Release Date

Release Date

Type

Type

jar
Description

Description

opener
WebJar for opener
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/domenic/opener

Download opener

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/opener/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>opener</artifactId>
    <version>1.5.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/opener/
implementation 'org.webjars.npm:opener:1.5.2'
// https://jarcasting.com/artifacts/org.webjars.npm/opener/
implementation ("org.webjars.npm:opener:1.5.2")
'org.webjars.npm:opener:jar:1.5.2'
<dependency org="org.webjars.npm" name="opener" rev="1.5.2">
  <artifact name="opener" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='opener', version='1.5.2')
)
libraryDependencies += "org.webjars.npm" % "opener" % "1.5.2"
[org.webjars.npm/opener "1.5.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

It Opens Stuff

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

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:

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:

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:

{
    "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. And I like things that work on all three. Like Node.js. And Opener.

Versions

Version
1.5.2
1.5.1
1.4.3
1.4.1