An open API service indexing awesome lists of open source software.

https://github.com/ahkohd/get-mac-apps

Get a list of installed apps or check if app is installed on a Mac. ๐Ÿ๐Ÿ‘จโ€๐Ÿ’ป
https://github.com/ahkohd/get-mac-apps

apps macos nodejs

Last synced: about 1 year ago
JSON representation

Get a list of installed apps or check if app is installed on a Mac. ๐Ÿ๐Ÿ‘จโ€๐Ÿ’ป

Awesome Lists containing this project

README

          

# get-mac-apps

A Node.JS package that lists apps installed or check if app is installed on a Mac. ๐Ÿ๐Ÿ‘จโ€๐Ÿ’ป

## ๐Ÿ‘จโ€๐Ÿ’ป Install

```bash
$ npm install get-mac-apps
```

## ๐Ÿ”Œ Usage

```js
let getWinApps = require("get-mac-apps");

// ๐Ÿฆ„ Get the list of all installed apps...

getMacApps
.getApps()
.then(apps => console.log(apps))
.catch(error => console.log(error.message));

// ๐Ÿš€ Check if Terminal app is installed...

getMacApps
.isInstalled("Terminal")
.then(isInstalled => console.log(isInstalled))
.catch(error => console.log(error.message));
```

### โœ… OUTPUT

```ts
getApps() -> Array<{ _name: String,
arch_kind: String<'arch_i64' | any>,
lastModified: Date,
obtained_from: String<'unknown' | 'identified_developer', 'apple'>,
path: String,
version: String }> | Error

isInstalled(appName: String) -> boolean | Error

```

## ๐Ÿค” How it works

Easy as pie! We use Node.JS to spawn a `system profiler` process to profile apps installed on the Mac. We parse the resulting `plist`.

---

Try the `installed apps profiler` command on your terminal:

```bash
/usr/sbin/system_profiler -xml -detailLevel mini SPApplicationsDataType
```

## ๐Ÿ›  Development

```bash
git clone https://github.com/ahkohd/get-mac-apps.git
cd get-mac-apps

// run an example
npm test

```

## ๐Ÿงพ License

[MIT](./LICENSE.md)