-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12333bf
commit 66d3bc7
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
If need this for Electron, use [`shell.openItem()`](https://electronjs.org/docs/api/shell#shellopenitemfullpath) instead. | ||
|
||
Note: 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 (`[email protected]` or lower), keep in mind that the API is different. | ||
Note: The original [`open` package](https://github.com/pwnall/node-open) was previously 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 (`[email protected]` or lower), keep in mind that the API is different. | ||
|
||
#### Why? | ||
|
||
|
@@ -29,17 +29,17 @@ $ npm install open | |
const open = require('open'); | ||
|
||
(async () => { | ||
// Opens the image in the default image viewer and waits for the opened app to quit | ||
await open('unicorn.png', {wait: true}); | ||
// Opens the image in the default image viewer and waits for the opened app to quit. | ||
await open('unicorn.png', {wait: true}); | ||
console.log('The image viewer app quit'); | ||
|
||
// Opens the URL in the default browser | ||
// Opens the URL in the default browser. | ||
await open('https://sindresorhus.com'); | ||
|
||
// Opens the URL in a specified browser | ||
// Opens the URL in a specified browser. | ||
await open('https://sindresorhus.com', {app: 'firefox'}); | ||
|
||
// Specify app arguments | ||
// Specify app arguments. | ||
await open('https://sindresorhus.com', {app: ['google chrome', '--incognito']}); | ||
})(); | ||
``` | ||
|