detect-jxa
This is a simple micro-package to provide a function to determine if the current JavaScript environment is the JavaScript for Automation (‘JXA’) environment provided on Mac OS X / macOS versions 10.10 (‘Yosemite’) and later. (See also: JXA-Cookbook)
This allows you to branch behaviour depending on whether JXA's globals will be available or not:
const onJXA = require('detect-jxa')() if (onJXA) require('jxa-async/shim')
Installation
- DOCME
{{#function name="detectJXA"}} {{>header~}} {{>body~}} {{/function}}
License
© 2017 ELLIOTTCABLE. detect-jxa
is available under the ISC license.