1.5.2 • Published 4 years ago

opener v1.5.2

Weekly downloads
9,145,358
License
(WTFPL OR MIT)
Repository
github
Last release
4 years ago

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.

http-serverwebpack-bundle-analyzerfork-appcenter-cliagoriccomposer-playgrounddo-fn@architect-io/cli@dinert/utilsvuedragdropuploadimageskilli8n-react-native-fast-imagews4npmhttp-server-aconite@hugov/node-scatterplothoneywell-api@cashremit/cr-streamline-iconshoneywellhome-api@logigear/gondolajsmocha-report-generator@ymatuhin/builddeployd-referenceitnuxt-compactnuxt2webpack-bundle-analyzer-c-patchwebpack-bundle-analyzer-patchbb-chatsan-docit@juxtacode/rollup-plugin-serve-incognitogql_din_mod@hyiromori/markdown-previewko-editorphantomshotglue-js-documentation-builderpowerhost@jkitme/weather_citygtpmgtmpsteps-core@mink-opn/build-tokensunblock-block-save-variables@infinitebrahmanuniverse/nolb-openeupd-serverselfrefactor@everything-registry/sub-chunk-2382@soptq/node-project-template@ariyana/appauth@4fun/mockit@attrs/httpd@alexbosworth/tap@beisen/npm@darwishdev/dash-dev@danielkalen/mochawesome-report-generator@d2js/cli@delewis13/appauth@bluvision/dserver@bazumax/appcenter-cli@bumble/grunt-http-server@candygen/dev-server@gennadysx/tapnextjs-storiess8-http-serversabersreport-viewersec-oauth-js-clientservekoserver-cli-jsdtsensorium-serversend-datasetserver-liuxinruservlrservermockerwithharserveurservercraftzsysbzuulzx-webpack-bundle-analyzerzpszunz-static-servertwintapumi-webpack-bundle-analyzerumi-webpack-profiling-analyzerumi-plugin-bundle-analyzerui-helperufeufe-cliufe-cli-plugin-servscode-versionlens-evergreenvrungelvs-solution-opener-clivr-cinemavmirella-mdlinksviseo-custom-phonegapvite-bundle-analyzervformlmqvinpmverify-img-codevue-compmentvue-dev-clonetoolkit-report-generatortoon-cli
1.5.2

4 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.3

7 years ago

1.4.2

8 years ago

1.4.1

9 years ago

1.4.0

10 years ago

1.3.0

12 years ago

1.2.0

12 years ago

1.1.0

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago