I want to include code in my plugin that checks what version of Sketch is running so I can handle different API versions.
This will return something like 51.3
It might be better to check for the existence of methods/properties.
markh What would the code look like for checking for the existence of a method? For example:
You could do the following:
markh Thanks. Works perfectly!
Now I need to figure out how to cope without this method, which seems to have gone missing in Sketch 52.
Alternatively, you can do this:
const sketch = require('sketch')
console.log(sketch.version.sketch) // Sketch version, currently 52
console.log(sketch.version.api) // API version, currently 2.0.0
Hope it helps!