Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-prefs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-prefs

A native node module to access managed app preferences on macOS

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
486
increased by8.72%
Maintainers
1
Weekly downloads
 
Created
Source

MIT license PRs Welcome Actions Status

cf-prefs

$ yarn add cf-prefs

This native Node.js module allows you to read managed app preferences on macOS. It maps to the underlying CFPreferencesCopyAppValue family of APIs. This module only truly works in apps with valid bundle IDs (i.e. Electron apps).

API

prefs.getPreferenceValue(key)

  • key String - The preference key to fetch the value of, has to be a valid UTF-8 string.

Returns String | Integer | Boolean | Object | Array | undefined

Notes:

  • If the preference is not available you will receive undefined.

Example:

console.log('My Preference Value:', prefs.getPreferenceValue('MyAppsCoolPreference'))

permissions.isPreferenceForced(key)

  • key String - The preference key to determine if the value is forced, has to be a valid UTF-8 string.

Returns Boolean - Whether the preference key is "forced", if this method returns true you should not allow users to override this preference in your application as a system administrator has indicated this preference key is "forced". For more information check out the apple API docs.

Keywords

FAQs

Package last updated on 21 Jun 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc