# frontmost-app

> Get information of the frontmost app – the app that receives key events

Latest version **1.0.0** (published 2018-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install frontmost-app
pnpm add frontmost-app
yarn add frontmost-app
bun add frontmost-app
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-11-06 |
| First published | 2016-04-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | frontmost, app, application, workspace, information, os, macos, objective-c, async |

## Links

- npm: https://www.npmjs.com/package/frontmost-app
- Repository: https://github.com/shinnn/frontmost-app
- Homepage: https://github.com/shinnn/frontmost-app#readme
- Issues: https://github.com/shinnn/frontmost-app/issues
- npm.io page: https://npm.io/package/frontmost-app

## Dependencies (1)

- [platform-name](https://npm.io/package/platform-name.md) ^1.0.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-11-06
- 0.5.0 — 2018-09-29
- 0.4.0 — 2018-08-27
- 0.3.0 — 2018-08-23
- 0.2.0 — 2018-08-21
- 0.1.0 — 2018-08-17
- 0.0.1 — 2016-04-16
- 0.0.0 — 2016-04-13

## README

# frontmost-app

[![npm version](https://img.shields.io/npm/v/frontmost-app.svg)](https://www.npmjs.com/package/frontmost-app)
[![Build Status](https://travis-ci.com/shinnn/frontmost-app.svg?branch=master)](https://travis-ci.com/shinnn/frontmost-app)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/frontmost-app.svg)](https://coveralls.io/github/shinnn/frontmost-app?branch=master)

Get information of the frontmost app – the app that receives key events

```javascript
const frontmostApp = require('frontmost-app');

(async () => {
  await frontmostApp(); /*=> {
    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

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install frontmost-app
```

## API

```javascript
const frontmostApp = require('frontmost-app');
```

### 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](./LICENSE) © 2018 Shinnosuke Watanabe

---
_Source: https://npm.io/package/frontmost-app · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
