Socket
Socket
Sign inDemoInstall

@liangshen/mac-software

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @liangshen/mac-software

**用于获取 MAC 软件的偏好设置信息**


Version published
Maintainers
1
Install size
198 kB
Created

Readme

Source

@liangshen/mac-software

用于获取 MAC 软件的偏好设置信息

  • 支持偏好类型的范性
  • 使用 ESModule 模块方式

安装

npm i @liangshen/mac-software -S

使用方法

以 Iterm 软件为例 传入软件偏好的配置文件路径(${os.homedir()}/Library/Preferences/com.googlecode.iterm2.plist)

import {MacSoftware} from '@liangshen/mac-software';

export interface ItermPreferences {
    'New Bookmarks': {
        Name: string;
        Tags: any[];
    }[];
}

const iterm = new MacSoftware<ItermPreferences>(`${os.homedir()}/Library/Preferences/com.googlecode.iterm2.plist`);
const preferences = await iterm.getPreferences();
console.log(preferences);

ItermPreferences 定义类型可以由如下工具生成

详情请看

@liangshen/plist-cli

Keywords

FAQs

Last updated on 26 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc