node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

opn-cli

opn-cli Build Status

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 http://sindresorhus.com
    $ opn http://sindresorhus.com -- firefox
    $ opn http://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