opn-cli
A better node-open. Opens stuff like websites, files, executables. Cross-platform.
Install
$ npm install --global opn-cli
Usage
$ opn --help
Usage
$ opn <file|url> [--wait] [-- <app> [args]]
$ cat <file> | opn [--wait] [--ext] [-- <app> [args]]
Options
--wait Wait for the app to exit
--ext File extension for when stdin file type can't be detected
Examples
$ opn https://sindresorhus.com
$ opn https://sindresorhus.com -- firefox
$ opn https://sindresorhus.com -- 'google chrome' --incognito
$ opn unicorn.png
$ cat unicorn.png | opn
$ echo '<h1>Unicorns!</h1>' | opn --ext=html
The following file types are automagically detected when using stdin mode.
Related
- opn - API for this module
License
MIT © Sindre Sorhus