You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uses the command `open` on macOS, `start` on Windows and `xdg-open` on other platforms.
132
+
133
+
@param name - The app you want to open. Can be either builtin supported `open.apps` names or other name supported in platform.
134
+
@returns 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.
-[`firefox`](https://www.mozilla.org/firefox) - Web browser
131
137
-[`edge`](https://www.microsoft.com/edge) - Web browser
132
138
139
+
### open.openApp(name, options?)
140
+
141
+
Open an app.
142
+
143
+
Returns 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.
144
+
145
+
#### name
146
+
147
+
Type: `string`
148
+
149
+
The 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. If possible, use [`open.apps`](#openapps) which auto-detects the correct binary to use.
150
+
151
+
You 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.
152
+
153
+
#### options
154
+
155
+
Type: `object`
156
+
157
+
Same options as [`open`](#options) except `app` and with the following additions:
158
+
159
+
##### arguments
160
+
161
+
Type: `string[]`\
162
+
Default: `[]`
163
+
164
+
Arguments passed to the app.
165
+
166
+
These arguments are app dependent. Check the app's documentation for what arguments it accepts.
167
+
133
168
## Related
134
169
135
170
-[open-cli](https://github.com/sindresorhus/open-cli) - CLI for this module
0 commit comments