macos-manage-apps
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

macos-manage-apps

Launch and terminate apps on macOS

If you're on macOS 10.14.3 or earlier, you need to download the Swift runtime support libraries.

Install

$ npm install macos-manage-apps

Usage

const {launchApp, terminateApp} = require('macos-manage-apps');
 
(async () => {
  await launchApp('com.sindresorhus.Dato');
 
  await terminateApp('com.sindresorhus.Dato');
})();

API

launchApp(bundleId: string): Promise<true>

Tries to launch the app with the given bundle identifier. It will resolve if it succeeds, and reject with an error otherwise.

bundleId

The bundle identifier of the app.

terminateApp(bundleId: string): Promise<true>

Tries to terminate the app with the given bundle identifier. It will resolve if it succeeds, and reject with an error otherwise.

bundleId

The bundle identifier of the app.

isAppRunning(bundleId: string): Promise<true>

Check whether the app with the given bundle identifier is running. It will resolve with true if it's running and false otherwise.

bundleId

The bundle identifier of the app.

Related

  • mac-focus-window - Focus a window and bring it to the front on macOS
  • mac-windows - Provide Information about Application Windows running

License

MIT

Package Sidebar

Install

npm i macos-manage-apps

Weekly Downloads

21

Version

1.2.0

License

MIT

Unpacked Size

73.5 kB

Total Files

7

Last publish

Collaborators

  • gkaragkiaouris