{"id":19759032,"url":"https://github.com/mebtte/clrc","last_synced_at":"2025-04-30T12:32:30.950Z","repository":{"id":49324897,"uuid":"349042076","full_name":"mebtte/clrc","owner":"mebtte","description":"Parser for LRC and enhanced LRC.","archived":false,"fork":false,"pushed_at":"2023-11-27T13:49:33.000Z","size":786,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T18:47:30.004Z","etag":null,"topics":["lrc","lrc-parser","typescript"],"latest_commit_sha":null,"homepage":"https://mebtte.github.io/clrc","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/mebtte.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}},"created_at":"2021-03-18T11:08:27.000Z","updated_at":"2024-10-07T04:23:43.000Z","dependencies_parsed_at":"2024-06-19T16:22:01.586Z","dependency_job_id":"53387daf-730c-4490-ab8c-74010c908464","html_url":"https://github.com/mebtte/clrc","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"16cc49217a36fb8371dc1821f1c0541527222e91"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebtte%2Fclrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebtte%2Fclrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebtte%2Fclrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebtte%2Fclrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mebtte","download_url":"https://codeload.github.com/mebtte/clrc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224210812,"owners_count":17274185,"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":["lrc","lrc-parser","typescript"],"created_at":"2024-11-12T03:27:20.517Z","updated_at":"2024-11-12T03:27:21.087Z","avatar_url":"https://github.com/mebtte.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clrc [![version](https://img.shields.io/npm/v/clrc)](https://www.npmjs.com/package/clrc) [![license](https://img.shields.io/npm/l/clrc)](https://github.com/mebtte/react-lrc/blob/master/LICENSE) [![](https://img.shields.io/bundlephobia/minzip/clrc)](https://bundlephobia.com/result?p=clrc)\n\nParser for LRC and enhanced LRC. Here is a [playground](https://mebtte.github.io/clrc).\n\n[2.x README](https://github.com/mebtte/clrc/blob/5c6efcbbfe08d4021e0a7d6252088c5deca428f7/README.md)\n\n## Features\n\n- Typescript support\n- Browser \u0026 Node.js support\n- Simple format and enhanced format support\n\n## Install \u0026 Usage\n\n```bash\nnpm install clrc\n```\n\n```js\nimport { parse } from 'clrc';\n\nconst lrc = `[ar:张叶蕾]\nsomething wrong\n[00:54.04]每一辆飞车彻夜向前开\n[00:58.22]飞到了路崖边永不回来`;\n\nconsole.log(parse(lrc));\n```\n\nThe output is:\n\n```json\n[\n  {\n    \"lineNumber\": 0,\n    \"raw\": \"[ar:张叶蕾]\",\n    \"type\": \"metadata\",\n    \"key\": \"ar\",\n    \"value\": \"张叶蕾\"\n  },\n  {\n    \"lineNumber\": 1,\n    \"raw\": \"something wrong\",\n    \"type\": \"invalid\"\n  },\n  {\n    \"lineNumber\": 2,\n    \"raw\": \"[00:54.04]每一辆飞车彻夜向前开\",\n    \"type\": \"lyric\",\n    \"startMillisecond\": 54040,\n    \"content\": \"每一辆飞车彻夜向前开\"\n  },\n  {\n    \"lineNumber\": 3,\n    \"raw\": \"[00:58.22]飞到了路崖边永不回来\",\n    \"type\": \"lyric\",\n    \"startMillisecond\": 58220,\n    \"content\": \"飞到了路崖边永不回来\"\n  }\n]\n```\n\n## Reference\n\n### parse(lrcString)\n\nparse lrc string to array.\n\n### parseEnhanced(lrcString)\n\nparse enhanced lrc string to array. here is a example:\n\n```txt\n[ti: Somebody to Love]\n[00:00.00] \u003c00:00.04\u003e When \u003c00:00.16\u003e the \u003c00:00.82\u003e truth \u003c00:01.29\u003e is \u003c00:01.63\u003e found \u003c00:03.09\u003e to \u003c00:03.37\u003e be \u003c00:05.92\u003e lies\n```\n\nthe output is:\n\n```json\n[\n  {\n    \"lineNumber\": 0,\n    \"raw\": \"[ti: Somebody to Love]\",\n    \"type\": \"metadata\",\n    \"key\": \"ti\",\n    \"value\": \" Somebody to Love\"\n  },\n  {\n    \"lineNumber\": 1,\n    \"raw\": \"[00:00.00] \u003c00:00.04\u003e When \u003c00:00.16\u003e the \u003c00:00.82\u003e truth \u003c00:01.29\u003e is \u003c00:01.63\u003e found \u003c00:03.09\u003e to \u003c00:03.37\u003e be \u003c00:05.92\u003e lies \",\n    \"type\": \"enhanced_lyric\",\n    \"startMillisecond\": 0,\n    \"content\": \" \u003c00:00.04\u003e When \u003c00:00.16\u003e the \u003c00:00.82\u003e truth \u003c00:01.29\u003e is \u003c00:01.63\u003e found \u003c00:03.09\u003e to \u003c00:03.37\u003e be \u003c00:05.92\u003e lies \",\n    \"words\": [\n      {\n        \"index\": 0,\n        \"raw\": \"\u003c00:00.04\u003e When \",\n        \"startMillisecond\": 40,\n        \"content\": \" When \"\n      },\n      {\n        \"index\": 1,\n        \"raw\": \"\u003c00:00.16\u003e the \",\n        \"startMillisecond\": 160,\n        \"content\": \" the \"\n      },\n      {\n        \"index\": 2,\n        \"raw\": \"\u003c00:00.82\u003e truth \",\n        \"startMillisecond\": 820,\n        \"content\": \" truth \"\n      },\n      {\n        \"index\": 3,\n        \"raw\": \"\u003c00:01.29\u003e is \",\n        \"startMillisecond\": 1290,\n        \"content\": \" is \"\n      },\n      {\n        \"index\": 4,\n        \"raw\": \"\u003c00:01.63\u003e found \",\n        \"startMillisecond\": 1630,\n        \"content\": \" found \"\n      },\n      {\n        \"index\": 5,\n        \"raw\": \"\u003c00:03.09\u003e to \",\n        \"startMillisecond\": 3090,\n        \"content\": \" to \"\n      },\n      {\n        \"index\": 6,\n        \"raw\": \"\u003c00:03.37\u003e be \",\n        \"startMillisecond\": 3370,\n        \"content\": \" be \"\n      },\n      {\n        \"index\": 7,\n        \"raw\": \"\u003c00:05.92\u003e lies \",\n        \"startMillisecond\": 5920,\n        \"content\": \" lies \"\n      }\n    ]\n  }\n]\n```\n\n### LineType\n\ntypes of line:\n\n- `LineType.INVALID` means it's invalid line\n- `LineType.METADATA` means it's metadata line\n- `LineType.LYRIC` means it's lyric line\n- `LineType.ENHANCED_LYRIC` means it's enhanced lyric line\n\n## Contributors\n\n\u003ca href=\"https://github.com/mebtte/clrc/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=mebtte/clrc\" /\u003e\n\u003c/a\u003e\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmebtte%2Fclrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmebtte%2Fclrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmebtte%2Fclrc/lists"}