1.5.2 • Published 5 years ago

opener v1.5.2

Weekly downloads
9,145,358
License
(WTFPL OR MIT)
Repository
github
Last release
5 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-2382taon-http-servertaco-clitanngotest-custom-openid-for-app-testwirebirdwix-webpack-bundle-analyzerweex-buildtoolwodax-umi-webpack-bundle-analyzerwomplib.jswaldenwamoyo-http-serverwd-servervue-http-servervue-button-test1webpack-reportwebpack_plugin_chartweex-previewerweexpack-libweextoolweextoolswenvwedmasterwx2anywuchuanteapackage-tatespoorman297storecomponentstorecomponent123storedependencystoreclistatic-blodetestapatest-reportertested-commitstest-speedtest-speed-fnsutoringswagger-viewertibetti-creatorvr-cinemavscode-versionlens-evergreenvrungelvscode-file-recoveryvtilevue-compmentv8-ic-processorv9u-smb2-singstorv8-map-processorvmirella-mdlinksvs-solution-opener-clivue-dev-clone@dojo/webpack-contrib@domain7/gemini-gui@dotconf-pro/dotconf-pro@dotconf-pro/dotenv@djlalwet/weather-city@clraconis/http-server@compodoc/ngd-cli
1.5.2

5 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.3

8 years ago

1.4.2

9 years ago

1.4.1

10 years ago

1.4.0

11 years ago

1.3.0

13 years ago

1.2.0

13 years ago

1.1.0

13 years ago

1.0.1

13 years ago

1.0.0

13 years ago