{"id":23913185,"url":"https://github.com/fs-frost/asu-regex-js","last_synced_at":"2026-06-12T22:32:36.140Z","repository":{"id":240823279,"uuid":"798561645","full_name":"FS-Frost/asu-regex-js","owner":"FS-Frost","description":"Parser to work with SubStation Alpha Subtitles (SSA/ASS) in TypeScript and JavaScript.","archived":false,"fork":false,"pushed_at":"2025-02-10T11:09:58.000Z","size":3089,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T12:22:00.954Z","etag":null,"topics":["aegisub","fansub","subtitles"],"latest_commit_sha":null,"homepage":"https://jsr.io/@fs-frost/asu","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FS-Frost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-10T02:54:23.000Z","updated_at":"2025-02-10T11:09:21.000Z","dependencies_parsed_at":"2024-05-31T01:34:40.508Z","dependency_job_id":"60a6283a-0686-48c5-a130-5d2f7625a5bf","html_url":"https://github.com/FS-Frost/asu-regex-js","commit_stats":null,"previous_names":["fs-frost/asu-regex-js"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FS-Frost%2Fasu-regex-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FS-Frost%2Fasu-regex-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FS-Frost%2Fasu-regex-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FS-Frost%2Fasu-regex-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FS-Frost","download_url":"https://codeload.github.com/FS-Frost/asu-regex-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356353,"owners_count":19788539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aegisub","fansub","subtitles"],"created_at":"2025-01-05T09:32:04.011Z","updated_at":"2026-06-12T22:32:36.128Z","avatar_url":"https://github.com/FS-Frost.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asu-regex-js\n\n![jsr](https://jsr.io/badges/@fs-frost/asu)\n![main](https://github.com/FS-Frost/asu-regex-js/actions/workflows/main.yml/badge.svg)\n\nParser to work with SubStation Alpha Subtitles (SSA/ASS) in TypeScript and JavaScript.\n\n[Read the documentation](https://fs-frost.github.io/asu-regex-js/docs)\n\n[Try the interactive playground](https://fs-frost.github.io/asu-regex-js)\n\n## Installation\n\n### Install using JSR (JavaScript Registry)\n\n```sh\nbunx jsr add @fs-frost/asu\n```\n\nFor NPM, Yarn, etc., check out https://jsr.io/@fs-frost/asu.\n\n### Install nightly bundles\n\nNightly bundles for Bun, Node and browser are available on [Bundles](https://fs-frost.github.io/asu-regex-js/bundles/).\n\n## Examples\n\nCheck out the [tests](https://github.com/FS-Frost/asu-regex-js/blob/main/src/asu.test.ts) or the [playground](https://fs-frost.github.io/asu-regex-js) for more examples.\n\n### Parse a dialogue\n\n```ts\nimport * as asu from \"@fs-frost/asu\";\n\n// Update font size from 32 to 16\nconst text = \"Dialogue: 0,1:23:45.67,2:34:56.78,Chitanda,actor,12,23,34,fx,{\\\\pos(182,421)}LINE 1\";\n\nconst line = asu.parseLine(text);\nif (line == null) {\n    console.error(\"invalid line\");\n    return;\n}\n\nline.style = \"Oreki\";\nline.content = \"Some {\\\\i1}other{\\\\i0} text\";\n\nconsole.log(asu.lineToString(line));\n// Dialogue: 0,1:23:45.67,2:34:56.78,Oreki,actor,12,23,34,fx,Some {\\i1}other{\\i0} text\n```\n\n### Set tag\n\n```ts\nimport * as asu from \"@fs-frost/asu\";\n\n// Update font size from 32 to 16\nconst text = \"{\\\\be2\\\\fs32}Kirino-san\";\nconst items = asu.parseContent(text);\nasu.setFs(items, 16);\n\nconsole.log(asu.contentsToString(items));\n// {\\be2\\fs16}Kirino-san\n```\n### Find tag\n\n```ts\nimport * as asu from \"@fs-frost/asu\";\n\n// find blur\nconst text = \"{\\\\blur2\\\\fs32}Kirino-san\";\nconst items = asu.parseContent(text);\nconst tagBlur = asu.findBlur(items);\nif (tagBlur == null) {\n    console.error(\"blur not found\");\n    return;\n}\n\ntagBlur.value = 4;\nconsole.log(asu.contentsToString(items));\n// {\\blur4\\fs32}Kirino-san\n```\n\n### Create tag\n\n```ts\nimport * as asu from \"@fs-frost/asu\";\n\n// Create pos\nconst text = \"{\\\\be2\\\\fs32}Kirino-san\";\nconst items = asu.parseContent(text);\nasu.setPos(items, -20, 67.9);\n\nconsole.log(asu.contentsToString(items));\n// {\\be2\\fs32\\pos(-20,67.9)}Kirino-san\n```\n\n## Development\n\n### Requirements\n\n- [Bun (JavaScript runtime)](https://bun.sh/)\n\n### Install JS dependencies\n```sh\nbun install\n```\n\n### Run tests\n\n```sh\nbun test --coverage\nbunx eslint\nbun run bundle\nbun run test:publish\n```\n\n# Applications using Asu\n\n- [Asu for SyncRajo Fansub](https://github.com/FS-Frost/asu-web)\n- [Asu Playground](https://fs-frost.github.io/asu-regex-js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs-frost%2Fasu-regex-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffs-frost%2Fasu-regex-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs-frost%2Fasu-regex-js/lists"}