{"id":25414066,"url":"https://github.com/daiz/cutlass","last_synced_at":"2026-02-09T06:09:08.927Z","repository":{"id":13056247,"uuid":"15736451","full_name":"Daiz/cutlass","owner":"Daiz","description":"A JavaScript library / Node.js module for dealing with ASS subtitles.","archived":false,"fork":false,"pushed_at":"2014-04-10T05:36:48.000Z","size":336,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T18:58:32.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"LiveScript","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/Daiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-08T13:42:06.000Z","updated_at":"2022-03-27T17:36:12.000Z","dependencies_parsed_at":"2022-08-28T06:03:15.672Z","dependency_job_id":null,"html_url":"https://github.com/Daiz/cutlass","commit_stats":null,"previous_names":["daiz-/cutlass"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fcutlass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fcutlass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fcutlass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fcutlass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daiz","download_url":"https://codeload.github.com/Daiz/cutlass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249766489,"owners_count":21322604,"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":[],"created_at":"2025-02-16T14:35:29.755Z","updated_at":"2026-02-09T06:09:05.480Z","avatar_url":"https://github.com/Daiz.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cutlass - JS library for ASS subtitles\n\n*cutlass* is a Node.js module / JavaScript library for parsing and dealing with ASS subtitles.\n\n## Installation\n\nInstallation is simple with npm:\n\n```bash\n$ npm install cutlass\n```\n\n## Basic Info and Examples\n\n*cutlass* exports an object with four classes: Script, Event, Style and Color. The one you usually want to deal with is Script, which represents a whole ASS script. (For more detailed info about the classes and the functions and properties they export, refer to `src/parser.ls` for the time being.)\n\n```javascript\nvar ass = require('cutlass');\nvar rawAss1 = \"...\" // pretend this is a full ASS script read from disk\nvar rawAss2 = \"...\" // this too\n\nvar script1 = new ass.Script(rawAss1);\n\n// sort the script by event start time\nscript1.sort();\n\n// get the script as raw ASS\nvar rawScript1 = script1.toAss();\n\nvar script2 = new ass.Script(rawAss2);\n\n// for this script, we want to move all lines with the style \"Sign\" to the top.\n// `script.events` is a plain JS array, so we can use them our purpose here.\nvar signs = [];\nvar dialogue = [];\nfor (var i = 0, len = script2.events.length; i \u003c len; ++i) {\n  var line = script2.events[i];\n  if (line.style === \"Sign\") {\n    signs.push(line);\n  } else {\n    dialogue.push(line);\n  }\n}\nscript2.events = signs.concat(dialogue);\n\n// get the script as ASS\nvar rawScript2 = script2.toAss();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaiz%2Fcutlass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaiz%2Fcutlass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaiz%2Fcutlass/lists"}