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-clicomposer-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-2382judpackjudpack-libapm-login-cliAntonycordova-cohocordova-plugin-amplify-paycordova-plugin-amplify-paymentclpagecophercommandlinestorecode-push-clicode-push-cli-rcode-push-cli-smallworldcode-push-cli-v2code-push-cli-yxcodelabcomposer-uicool-clicornellcourse-vue-tplcozy-openercrud-report-generatordatex2-linkerdatetimemodulecsvtaskscssesc-wbgcss2stylecss-modules-examplecubx-bde-openercubx-grunt-http-servercubx-http-serverdata-loverscvillafu_test1dccsevanutilsem-pipeempiricalrunember-cli-openexerslideexprexofattest-cat-bcspcafattest-catfeaturebookfenix-clifeanorfiles-previewfiles-preview-threefilmstrip-reporterfirewatchfireworks-clifirst-app-lyfucifiredev-http-serverelefrantioee-runneredit-roblox-placeelectron-appauthelectrode-electrifyfly-cli
1.5.2

4 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

10 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