{"id":15674572,"url":"https://github.com/lambdalisue/deno-ansi-escape-code","last_synced_at":"2025-05-06T23:22:40.390Z","repository":{"id":62422596,"uuid":"471731394","full_name":"lambdalisue/deno-ansi-escape-code","owner":"lambdalisue","description":"🦕 Utilities to trim and parse ANSI escape code","archived":false,"fork":false,"pushed_at":"2024-04-06T06:04:31.000Z","size":27,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T03:51:42.234Z","etag":null,"topics":["ansi-escape-code","deno","jsr"],"latest_commit_sha":null,"homepage":"https://jsr.io/@lambdalisue/ansi-escape-code","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/lambdalisue.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":"2022-03-19T15:12:55.000Z","updated_at":"2024-05-25T11:00:11.000Z","dependencies_parsed_at":"2024-04-06T06:30:21.256Z","dependency_job_id":"f60a5a4b-9336-4492-a573-41cd148d332a","html_url":"https://github.com/lambdalisue/deno-ansi-escape-code","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-ansi-escape-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-ansi-escape-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-ansi-escape-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-ansi-escape-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdalisue","download_url":"https://codeload.github.com/lambdalisue/deno-ansi-escape-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252783898,"owners_count":21803575,"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":["ansi-escape-code","deno","jsr"],"created_at":"2024-10-03T15:47:01.841Z","updated_at":"2025-05-06T23:22:40.368Z","avatar_url":"https://github.com/lambdalisue.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansi-escape-code\n\n[![jsr](https://img.shields.io/jsr/v/%40lambdalisue/ansi-escape-code?logo=javascript\u0026logoColor=white)](https://jsr.io/@lambdalisue/ansi-escape-code)\n[![denoland](https://img.shields.io/github/v/release/lambdalisue/deno-ansi-escape-code?logo=deno\u0026label=denoland)](https://github.com/lambdalisue/deno-ansi-escape-code/releases)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/ansi_escape_code/mod.ts)\n[![Test](https://github.com/lambdalisue/deno-ansi-escape-code/workflows/Test/badge.svg)](https://github.com/lambdalisue/deno-ansi-escape-code/actions?query=workflow%3ATest)\n\nUtilities to trim and parse ANSI escape sequence.\n\n[deno]: https://deno.land/\n\n## Usage\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std@0.164.0/testing/asserts.ts\";\nimport { trimAndParse } from \"https://deno.land/x/ansi_escape_code/mod.ts\";\n\nconst [trimmed, annotations] = trimAndParse(\n  \"\\x1b[1mHe\\x1b[30mll\\x1b[31mo\\x1b[m world\",\n);\n\nassertEquals(trimmed, \"Hello world\");\nassertEquals(annotations, [\n  { offset: 0, raw: \"\\x1b[1m\", csi: { sgr: { bold: true } } },\n  { offset: 2, raw: \"\\x1b[30m\", csi: { sgr: { foreground: 0 } } },\n  { offset: 4, raw: \"\\x1b[31m\", csi: { sgr: { foreground: 1 } } },\n  { offset: 5, raw: \"\\x1b[m\", csi: { sgr: { reset: true } } },\n]);\n```\n\n## License\n\nThe code follows MIT license written in [LICENSE](./LICENSE). Contributors need\nto agree that any modifications sent in this repository follow the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdalisue%2Fdeno-ansi-escape-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdalisue%2Fdeno-ansi-escape-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdalisue%2Fdeno-ansi-escape-code/lists"}