frontmost-app
Get information of the frontmost app – the app that receives key events
const frontmostApp = ; async { await ; /*=> { localizedName: 'Safari', bundleId: 'com.apple.Safari', bundlePath: '/Applications/Safari.app', executablePath: '/Applications/Safari.app/Contents/MacOS/Safari', isLaunched: true, pid: 30096 } */};
This module only supports macOS.
Installation
npm install frontmost-app
API
const frontmostApp = ;
frontmostApp()
Return: Promise<Object>
The resultant object has the following properties:
localizedName
Type: string
The localized name of the frontmost application.
bundleId
Type: string
The bundle identifier of the frontmost application.
bundlePath
Type: string
The path to the frontmost application's bundle.
executablePath
Type: string
The path to the frontmost application's executable.
isLaunched
Type: boolean
Whether the frontmost application has finished launching.
pid
Type: integer
The process identifier of the frontmost application.
License
ISC License © 2018 Shinnosuke Watanabe