{"id":20188540,"url":"https://github.com/weizhenye/ass-compiler","last_synced_at":"2025-05-16T03:06:50.015Z","repository":{"id":57184957,"uuid":"92774557","full_name":"weizhenye/ass-compiler","owner":"weizhenye","description":"Parses and compiles ASS subtitle format to easy-to-use data structure","archived":false,"fork":false,"pushed_at":"2025-02-03T06:15:34.000Z","size":185,"stargazers_count":116,"open_issues_count":0,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-19T05:14:09.351Z","etag":null,"topics":["ass","compiler","parser","ssa","subtitle"],"latest_commit_sha":null,"homepage":"https://ass.js.org/ass-compiler/","language":"JavaScript","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/weizhenye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-05-29T20:51:47.000Z","updated_at":"2025-04-17T10:17:00.000Z","dependencies_parsed_at":"2023-10-03T08:41:33.809Z","dependency_job_id":"d1fed04b-e2d6-422b-9072-ad6b47648e28","html_url":"https://github.com/weizhenye/ass-compiler","commit_stats":{"total_commits":80,"total_committers":5,"mean_commits":16.0,"dds":0.0625,"last_synced_commit":"48444e8050d6c5ce6ae017e784b20cec364da39b"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weizhenye%2Fass-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weizhenye%2Fass-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weizhenye%2Fass-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weizhenye%2Fass-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weizhenye","download_url":"https://codeload.github.com/weizhenye/ass-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"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":["ass","compiler","parser","ssa","subtitle"],"created_at":"2024-11-14T03:29:34.557Z","updated_at":"2025-05-16T03:06:45.006Z","avatar_url":"https://github.com/weizhenye.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ass-compiler\n\n[![GitHub Action](https://img.shields.io/github/actions/workflow/status/weizhenye/ass-compiler/ci.yml?logo=github)](https://github.com/weizhenye/ass-compiler/actions)\n[![Codecov](https://img.shields.io/codecov/c/gh/weizhenye/ass-compiler?logo=codecov)](https://codecov.io/gh/weizhenye/ass-compiler)\n[![License](https://img.shields.io/npm/l/ass-compiler)](https://github.com/weizhenye/ass-compiler/blob/master/LICENSE)\n[![NPM Version](https://img.shields.io/npm/v/ass-compiler?logo=npm)](https://www.npmjs.com/package/ass-compiler)\n[![jsDelivr](https://img.shields.io/jsdelivr/npm/hm/ass-compiler?logo=jsdelivr)](https://www.jsdelivr.com/package/npm/ass-compiler)\n[![File size](https://img.shields.io/bundlejs/size/ass-compiler)](https://bundlephobia.com/result?p=ass-compiler)\n\nParses and compiles ASS subtitle format to easy-to-use data structure.\n\n[Online Viewer](https://ass.js.org/ass-compiler/)\n\n## Installation\n\n```bash\nnpm install ass-compiler\n```\n\n## Usage\n\nYou can use `parse` or `compile` as your need.\n\n```js\nimport { parse, stringify, compile, decompile } from 'ass-compiler';\n\n// ASS file content\nconst text = `\n[Script Info]\n; ...\n`;\n\n// parse just turn ASS text into JSON\nconst parsedASS = parse(text);\nconst stringifiedText = stringify(parsedASS);\n\n// compile will get rid of invalid tags, merge duplicated tags, transform drawings, etc.\nconst compiledASS = compile(text, options);\nconst decompiledText = decompile(compiledASS);\n```\n\n### options\n\n```js\n{\n  // Used for default values if it's not in `[Script Info]` section.\n  defaultInfo: {\n    PlayResX: 1280,\n    PlayResY: 720,\n  },\n  // A Style named `Default` will be automatic generated by options.defaultStyle\n  // if it is not exists in `[V4+ Style]` section.\n  defaultStyle: {\n    Name: 'Default',\n    Fontname: 'Arial',\n    Fontsize: '20',\n    PrimaryColour: '\u0026H00FFFFFF\u0026',\n    SecondaryColour: '\u0026H000000FF\u0026',\n    OutlineColour: '\u0026H00000000\u0026',\n    BackColour: '\u0026H00000000\u0026',\n    Bold: '0',\n    Italic: '0',\n    Underline: '0',\n    StrikeOut: '0',\n    ScaleX: '100',\n    ScaleY: '100',\n    Spacing: '0',\n    Angle: '0',\n    BorderStyle: '1',\n    Outline: '2',\n    Shadow: '2',\n    Alignment: '2',\n    MarginL: '10',\n    MarginR: '10',\n    MarginV: '10',\n    Encoding: '1',\n  },\n}\n```\n\nFor details of data structure, please use the [online viewer](https://ass.js.org/ass-compiler/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweizhenye%2Fass-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweizhenye%2Fass-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweizhenye%2Fass-compiler/lists"}