{"id":18852711,"url":"https://github.com/tatsh/jxa-lib","last_synced_at":"2026-05-02T22:01:56.739Z","repository":{"id":42490818,"uuid":"144194741","full_name":"Tatsh/jxa-lib","owner":"Tatsh","description":"General library for AppleScript (JXA).","archived":false,"fork":false,"pushed_at":"2026-04-24T00:52:16.000Z","size":5184,"stargazers_count":40,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-24T02:31:19.831Z","etag":null,"topics":["applescript","jxa","macos","typescript"],"latest_commit_sha":null,"homepage":"https://tatsh.github.io/jxa-lib/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tatsh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"Tatsh","ko_fi":"tatsh2","liberapay":"tatsh2","patreon":"tatsh2"}},"created_at":"2018-08-09T19:25:35.000Z","updated_at":"2026-04-24T00:52:20.000Z","dependencies_parsed_at":"2024-11-06T08:34:10.994Z","dependency_job_id":"907c44f2-7824-4e0f-9533-a5ead0c097df","html_url":"https://github.com/Tatsh/jxa-lib","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Tatsh/jxa-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tatsh%2Fjxa-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tatsh%2Fjxa-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tatsh%2Fjxa-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tatsh%2Fjxa-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tatsh","download_url":"https://codeload.github.com/Tatsh/jxa-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tatsh%2Fjxa-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32550914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T21:31:48.061Z","status":"ssl_error","status_checked_at":"2026-05-02T21:31:46.574Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","jxa","macos","typescript"],"created_at":"2024-11-08T03:41:16.718Z","updated_at":"2026-05-02T22:01:56.734Z","avatar_url":"https://github.com/Tatsh.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Tatsh","https://ko-fi.com/tatsh2","https://liberapay.com/tatsh2","https://patreon.com/tatsh2","https://buymeacoffee.com/Tatsh","https://www.patreon.com/Tatsh2"],"categories":[],"sub_categories":[],"readme":"# Library for JXA\n\n\u003c!-- WISWA-GENERATED-README:START --\u003e\n\n[![NPM Version](https://img.shields.io/npm/v/jxa-lib)](https://www.npmjs.com/package/jxa-lib)\n[![NPM Downloads](https://img.shields.io/npm/dm/jxa-lib)](https://www.npmjs.com/package/jxa-lib)\n[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/jxa-lib)](https://github.com/Tatsh/jxa-lib/tags)\n[![License](https://img.shields.io/github/license/Tatsh/jxa-lib)](https://github.com/Tatsh/jxa-lib/blob/master/LICENSE.txt)\n[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/jxa-lib/v0.1.10/master)](https://github.com/Tatsh/jxa-lib/compare/v0.1.10...master)\n[![CodeQL](https://github.com/Tatsh/jxa-lib/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tatsh/jxa-lib/actions/workflows/codeql.yml)\n[![QA](https://github.com/Tatsh/jxa-lib/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/jxa-lib/actions/workflows/qa.yml)\n[![Tests](https://github.com/Tatsh/jxa-lib/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/jxa-lib/actions/workflows/tests.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Tatsh/jxa-lib/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/jxa-lib?branch=master)\n[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://github.com/dependabot)\n[![GitHub Pages](https://github.com/Tatsh/jxa-lib/actions/workflows/pages.yml/badge.svg)](https://tatsh.github.io/jxa-lib/)\n[![Stargazers](https://img.shields.io/github/stars/Tatsh/jxa-lib?logo=github\u0026style=flat)](https://github.com/Tatsh/jxa-lib/stargazers)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![Prettier](https://img.shields.io/badge/Prettier-black?logo=prettier)](https://prettier.io/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-black?logo=typescript)](https://www.typescriptlang.org/)\n[![Yarn](https://img.shields.io/badge/Yarn-4c335c?logo=yarn)](https://yarnpkg.com/)\n[![eslint](https://img.shields.io/badge/eslint-black?logo=eslint)](https://www.npmjs.com/package/eslint)\n[![jest](https://img.shields.io/badge/jest-black?logo=jest)](https://www.npmjs.com/package/jest)\n\n[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor=did%3Aplc%3Auq42idtvuccnmtl57nsucz72\u0026query=%24.followersCount\u0026label=Follow+%40Tatsh\u0026logo=bluesky\u0026style=social)](https://bsky.app/profile/Tatsh.bsky.social)\n[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Tatsh-black?logo=buymeacoffee)](https://buymeacoffee.com/Tatsh)\n[![Libera.Chat](https://img.shields.io/badge/Libera.Chat-Tatsh-black?logo=liberadotchat)](irc://irc.libera.chat/Tatsh)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social\u0026style=social)](https://hostux.social/@Tatsh)\n[![Patreon](https://img.shields.io/badge/Patreon-Tatsh2-F96854?logo=patreon)](https://www.patreon.com/Tatsh2)\n\n\u003c!-- WISWA-GENERATED-README:STOP --\u003e\n\nThis is a helper library for AppleScript in JavaScript that works on macOS 10.10 and above. To\nproperly use this, a bundler must be used such as Webpack. It is recommended to install\n[`jxa-types`](https://www.npmjs.com/package/jxa-types) as well.\n\nThis repository also demonstrates how to write tests mocking the JXA environment. See the `*.test.ts`\nfiles in `src`.\n\n## Example use\n\n```typescript\nimport { FileManager } from 'jxa-lib';\n\nconst fm = new FileManager();\nlet attr;\ntry {\n  attr = fm.attributesOfItem('/some-file');\n} catch (e) {\n  // Instead of having to pass \u0026error (Ref object) like in Objective-C,\n  // an exception is thrown\n  console.log('Maybe /some-file does not exist?');\n}\n\n// attr type is FileAttributes or undefined, which does not have prefixes removed\nif (attr) {\n  console.log(attr.NSFileGroupOwnerAccountID); // string\n  console.log(attr.NSFileModificationDate); // Date object\n}\n```\n\n## Example with C functions\n\nYou do not have to use `ObjC.import()` because all modules will do this on their own.\n\n```typescript\nimport { stdlib, string } from 'jxa-lib';\n\nconst size = 32;\nconst buf = stdlib.malloc(size); // returns Ref\u003cnumber\u003e\nstring.memset(buf, 0, size);\nfor (let i = 0, c = 'a'.charCodeAt(0); i \u003c size; i++, c++) {\n  buf[i] = c;\n}\n\nconst asciiC = 'c'.charCodeAt(0);\nconst asciiD = 'd'.charCodeAt(0);\n\n// memchr() returns Ref\u003cnumber\u003e or Ref to NULL\nconst result = string.memchr(buf, asciiC, size);\nif (result[0]) {\n  // this will be asciiC or null/undefined\n  console.log(result[0] === asciiC); // true\n  console.log(result[1] === asciiD); // true\n\n  // Getting result[30] or above is not defined behaviour\n}\n\nstdlib.free(result);\n\n// Do not print the result of the last expression\nstdlib.exit(0);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatsh%2Fjxa-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftatsh%2Fjxa-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatsh%2Fjxa-lib/lists"}