app-path

Get the path to an app (macOS)

MIT 11 个版本
安装
npm install app-path
yarn add app-path
pnpm add app-path
bun add app-path
README

app-path

Get the path to an app (macOS)

Install

$ npm install app-path

Usage

import appPath from 'app-path';

console.log(await appPath('Safari'));
//=> '/Applications/Safari.app'

console.log(await appPath('com.apple.Safari'));
//=> '/Applications/Safari.app'

console.log(appPath.sync('Safari'));
//=> '/Applications/Safari.app'

API

appPath(appName)

Returns a Promise<string> with the path to the app specified in appName. Rejects when run on any other operating system than macOS.

appPath.sync(appName)

Returns the path to the app specified in appName. Throws when run on any other operating system than macOS.

appName

Type: string

An app name or bundle identifier.

版本列表
4.0.0 2021-05-03
3.3.0 2021-04-29
3.2.0 2019-03-31
3.1.0 2019-03-20
3.0.0 2018-12-01
2.2.0 2016-06-14
2.1.0 2016-03-17
2.0.0 2016-03-08
1.0.2 2015-05-19
1.0.1 2015-05-18
1.0.0 2015-05-18