A example code for @jxa
packages.
import "@jxa/global-type";
import { run } from "@jxa/run";
/**
* get safari version
* This function execute JXA code
*/
export const safariVersion = () => {
return run(() => {
const Safari = Application("Safari");
return Safari.version();
});
};
/**
* get current mac system user
* This function execute JXA code
*/
export const currentUserName = () => {
return run(() => {
const sys = Application("System Events");
return sys.currentUser().name();
});
};
// This main is just a Node.js code
export const example = async () => {
const version = await safariVersion();
const userName = await currentUserName();
return `User: ${userName}, Safari: ${version}`;
};
yarn
yarn run build
node lib/cli.js
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu