{"_id":"@cjser/run-jxa__v3_0_0","name":"@cjser/run-jxa__v3_0_0","dist-tags":{"latest":"3.0.0-cjser.2"},"versions":{"3.0.0-cjser.2":{"name":"@cjser/run-jxa__v3_0_0","version":"3.0.0-cjser.2","description":"Run JXAcode and get the result","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["macos","jxa","javascript","osascript","run","mac","execute","code","script","automation"],"dependencies":{"execa":"^5.1.1","type-fest":"^2.0.0","@cjser/macos-version":"6.0.0-cjser.2","@cjser/subsume":"4.0.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.0","cjserVersion":2,"original":{"name":"run-jxa","version":"3.0.0","exports":"./index.js","repository":"sindresorhus/run-jxa","dependencies":{"execa":"^5.1.1","macos-version":"^6.0.0","subsume":"^4.0.0","type-fest":"^2.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/run-jxa__v3_0_0@3.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-8AASltGB4G3yyzPraFTCavhvvKhVfou/A0J7rHMCD6bjUsPZUeGv59+LQff8cZ8rRZzDblWZiza0EuP0Ln7LVw==","shasum":"99b871bfa99a10f4c3b9def3703d4ec1a403afe9","tarball":"https://registry.npmjs.org/@cjser/run-jxa__v3_0_0/-/run-jxa__v3_0_0-3.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":12527,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC2QBZVT1J3vq1duGqRcApTH68rCd0Nz3BlcG6F2DKf2AIhALgNcCxFLdNwNB5QRvWVZuw6sVflPKyHXExtR17+93gW"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-jxa__v3_0_0_3.0.0-cjser.2_1778159902886_0.8352149888600828"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:18:22.823Z","3.0.0-cjser.2":"2026-05-07T13:18:23.100Z","modified":"2026-05-07T13:18:23.315Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Run JXAcode and get the result","keywords":["macos","jxa","javascript","osascript","run","mac","execute","code","script","automation"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# run-jxa\n\n> Run [JXA](https://github.com/dtinth/JXA-Cookbook) code and get the result\n\n*JXA is JavaScript for Automation on macOS. Requires macOS 10.10 or later.*\n\n## Install\n\n```\n$ npm install run-jxa\n```\n\n## Usage\n\nUse a function:\n\n```js\nimport {runJxa} from 'run-jxa';\n\nconst result = await runJxa((unicorn, horse) => {\n\t// This is run in the JXA engine\n\treturn `I love ${unicorn} & ${horse}`;\n}, ['🦄', '🐴']);\n\nconsole.log(result);\n//=> 'I love 🦄 & 🐴'\n```\n\nOr a string:\n\n```js\nimport {runJxa} from 'run-jxa';\n\nconst result = await runJxa(`\n\tconst [unicorn, horse] = args;\n\treturn \\`I love \\${unicorn} & \\${horse}\\`;\n`, ['🦄', '🐴']);\n\nconsole.log(result);\n//=> 'I love 🦄 & 🐴'\n```\n\n## API\n\n### runJxa(input, arguments?)\n\nReturns a `Promise` for the value returned from `input`.\n\n### runJxaSync(input, arguments?)\n\nReturns the value returned from `input`.\n\n#### input\n\nType: `Function | string`\n\nIf a function, it's stringified and passed to JXA. It should be [pure](https://en.wikipedia.org/wiki/Pure_function), meaning it doesn't access anything outside its body.\n\nIf a string, you can access the specified arguments with `args` array. Use the `arguments` parameter rather than template interpolation so you don't have to do escaping.\n\nYou can `console.log` inside `input`. It will be forwarded to stdout. Useful for debugging.\n\nNote: The JXA context is completely synchronous, so asynchronous functions like `setTimeout` are not available.\n\n#### arguments\n\nType: `unknown[]`\n\nArguments to pass to the JXA context.\n\nItems should be serializable (`JSON.stringify`'able).\n\n## Related\n\n- [is-jxa](https://github.com/sindresorhus/is-jxa) - Check if your code is running in a JXA environment\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/run-jxa\n","readmeFilename":"readme.md","_rev":"1-98287c8aeaa54919bbe0884a2f03bfc7"}