get-mac-apps

1.0.2 • Public • Published

get-mac-apps

A Node.JS package that lists apps installed or check if app is installed on a Mac. 🍏👨‍💻

👨‍💻 Install

$ npm install get-mac-apps

🔌 Usage

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

 getApps() -> Array<{ _nameString,
  arch_kindString<'arch_i64' | any>,
  lastModifiedDate,
  obtained_fromString<'unknown' | 'identified_developer', 'apple'>,
  pathString,
  versionString }> | Error
 
isInstalled(appNameString) -> 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:

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

🛠 Development

git clone https://github.com/ahkohd/get-mac-apps.git
cd get-mac-apps
 
// run an example
npm test
 

🧾 License

MIT

Package Sidebar

Install

npm i get-mac-apps

Weekly Downloads

28

Version

1.0.2

License

MIT

Unpacked Size

4.67 kB

Total Files

7

Last publish

Collaborators

  • ahkohd