{"name":"opn","version":"3.0.2","description":"A better node-open. Opens stuff like websites, files, executables. Cross-platform.","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/opn"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","xdg-open"],"keywords":["app","open","opn","opener","opens","launch","start","xdg-open","xdg","default","cmd","browser","editor","executable","exe","url","urls","arguments","args","spawn","exec","child","process","website","file"],"dependencies":{"object-assign":"^3.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"57ac2666dace81593b78a2e59f2ab397f88a90d9","bugs":{"url":"https://github.com/sindresorhus/opn/issues"},"homepage":"https://github.com/sindresorhus/opn","_id":"opn@3.0.2","_shasum":"d3380607008b2e5cc41e7bd524f54c6adbdeea78","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d3380607008b2e5cc41e7bd524f54c6adbdeea78","tarball":"http://registry-npm.ywwl.com/opn/download/opn-3.0.2.tgz","integrity":"sha512-PeeVq3g+Pp2vdo1Qz5H7/3B6y9S0IXB7K94AORgKF9mM5t67wHoyJVweKMg2ZQDQoBACLdqQK4OsDxeM6eGCwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWA6A5V78giTr8KtlUqTv+B3C79vGzS+UXZGNb2Q5jmAiEAlxY5D5l1yoKvDB+IZgJA+eLtIW6JnyrGnWoq4hydAhk="}],"size":8535,"noattachment":false,"key":"/opn/-/opn-3.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"readme":"# open\n\n> Open stuff like URLs, files, executables. Cross-platform.\n\nIf need this for Electron, use [`shell.openItem()`](https://electronjs.org/docs/api/shell#shellopenitemfullpath) instead.\n\nNote: The original [`open` package](https://github.com/pwnall/node-open) was recently deprecated in favor of this package, and we got the name, so this package is now named `open` instead of `opn`. If you're upgrading from the original `open` package (`open@0.0.5` or lower), keep in mind that the API is different.\n\n#### Why?\n\n- Actively maintained.\n- Supports app arguments.\n- Safer as it uses `spawn` instead of `exec`.\n- Fixes most of the open original `node-open` issues.\n- Includes the latest [`xdg-open` script](http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c55122295c2a480fa721a9614f0e2d42b2949c18) for Linux.\n- Supports WSL paths to Windows apps under `/mnt/*`.\n\n\n## Install\n\n```\n$ npm install open\n```\n\n\n## Usage\n\n```js\nconst open = require('open');\n\n// Opens the image in the default image viewer\n(async () => {\n\tawait open('unicorn.png', {wait: true});\n\tconsole.log('The image viewer app closed');\n\n\t// Opens the url in the default browser\n\tawait open('https://sindresorhus.com');\n\n\t// Specify the app to open in\n\tawait open('https://sindresorhus.com', {app: 'firefox'});\n\n\t// Specify app arguments\n\tawait open('https://sindresorhus.com', {app: ['google chrome', '--incognito']});\n})();\n```\n\n\n## API\n\nIt uses the command `open` on macOS, `start` on Windows and `xdg-open` on other platforms.\n\n### open(target, [options])\n\nReturns a promise for the [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You would normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process.\n\n#### target\n\nType: `string`\n\nThe thing you want to open. Can be a URL, file, or executable.\n\nOpens in the default app for the file type. For example, URLs opens in your default browser.\n\n#### options\n\nType: `Object`\n\n##### wait\n\nType: `boolean`<br>\nDefault: `false`\n\nWait for the opened app to exit before fulfilling the promise. If `false` it's fulfilled immediately when opening the app.\n\nNote that it waits for the app to exit, not just for the window to close.\n\nOn Windows, you have to explicitly specify an app for it to be able to wait.\n\n##### app\n\nType: `string | string[]`\n\nSpecify the app to open the `target` with, or an array with the app and app arguments.\n\nThe app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows.\n\nYou may also pass in the app's full path. For example on WSL, this can be `/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe` for the Windows installation of Chrome.\n\n\n## Related\n\n- [opn-cli](https://github.com/sindresorhus/opn-cli) - CLI for this module\n- [open-editor](https://github.com/sindresorhus/open-editor) - Open files in your editor at a specific line and column\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","publish_time":1435604898488,"_cnpm_publish_time":1435604898488,"dist-tags":{"latest":"6.0.0"}}