sketch-module-user-preferences

A sketch module to manage a plugin's user preferences

Usage no npm install needed!

<script type="module">
  import sketchModuleUserPreferences from 'https://cdn.skypack.dev/sketch-module-user-preferences';
</script>

README

sketch-module-update

Downloads per month Latest version

A sketch module to manage a plugin's user preferences.

Usage

import prefsManager from 'sketch-module-user-preferences'

const defaultPreferences = {
  timeBetweenChecks: 24 * 60 * 60 * 1000, // 1 day by default
  exportFolder: '.exportedArtboards',
  diffByDefault: true
}

const preferences = prefsManager.getUserPreferences('myPluginName', defaultPreferences)

prefsManager.setUserPreferences('myPluginName', {
  timeBetweenChecks: 3 * 24 * 60 * 60 * 1000, // 3 days now
})

Installation

sketch-module-user-preferences is available from npm.

npm install --save sketch-module-user-preferences

Compatibility

sketch-module-user-preferences requires Sketch >= 3