A sketch module to check if an plugin's update is available
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
README.md
package.json

README.md

sketch-module-update

Downloads per month Latest version

A sketch module to check if an plugin's update is available on Github and prompt the user to download it.

Usage

update.js:

import update from 'sketch-module-update'

const repoFullName = 'mathieudutour/git-sketch-plugin'

const optionalOptions = {
  timeBetweenChecks: 24 * 60 * 60 * 1000, // 1 day by default
  title: 'A new MyPluginName plugin version is available!'
}

export default update(repoFullName, optionalOptions)

manifest.json:

...
"commands": [
  {
    "name": "update",
    "identifier": "update",
    "script": "update.cocoascript",
    "handlers" : {
      "actions": {
        "OpenDocument": "onRun"
      }
    }
  },
...

API Documentation

Options available:

name default
timeBetweenChecks 24 * 60 * 60 * 1000
prefKey repoFullName + '-update-last-check'
customizeAlert function (context, alert) {}
title 'A new ' + repo + ' plugin version is available!'
okButton Download update
laterButton Remind me later

Installation

sketch-module-update is available from npm.

npm install --save sketch-module-update

Compatibility

sketch-module-update requires Sketch >= 3.4 (not with the sandboxed version ie from the App Store).