Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/app-path
Get the path to an app (macOS)
https://github.com/sindresorhus/app-path
Last synced: 4 days ago
JSON representation
Get the path to an app (macOS)
- Host: GitHub
- URL: https://github.com/sindresorhus/app-path
- Owner: sindresorhus
- License: mit
- Created: 2015-05-18T17:36:45.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2022-07-09T03:59:13.000Z (over 2 years ago)
- Last Synced: 2024-10-29T22:38:20.401Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 63
- Watchers: 6
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-starred-test - sindresorhus/app-path - Get the path to an app (macOS) (JavaScript)
README
# app-path
> Get the path to an app *(macOS)*
## Install
```
$ npm install app-path
```## Usage
```js
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` 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.
## Related
- [app-path-cli](https://github.com/sindresorhus/app-path-cli) - CLI for this module