{"id":16508522,"url":"https://github.com/osteele/terminal-codes-to-html","last_synced_at":"2026-06-08T03:32:37.948Z","repository":{"id":57376720,"uuid":"424903108","full_name":"osteele/terminal-codes-to-html","owner":"osteele","description":"Convert strings that include terminal color codes to HTML or plain text.","archived":false,"fork":false,"pushed_at":"2021-11-05T10:08:34.000Z","size":89,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-19T15:41:22.575Z","etag":null,"topics":["html-formatter","terminal-colors","vt100"],"latest_commit_sha":null,"homepage":"","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/osteele.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}},"created_at":"2021-11-05T10:06:01.000Z","updated_at":"2025-03-06T21:05:54.000Z","dependencies_parsed_at":"2022-09-02T18:02:05.287Z","dependency_job_id":null,"html_url":"https://github.com/osteele/terminal-codes-to-html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osteele/terminal-codes-to-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fterminal-codes-to-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fterminal-codes-to-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fterminal-codes-to-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fterminal-codes-to-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osteele","download_url":"https://codeload.github.com/osteele/terminal-codes-to-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osteele%2Fterminal-codes-to-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34047266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["html-formatter","terminal-colors","vt100"],"created_at":"2024-10-11T15:45:59.908Z","updated_at":"2026-06-08T03:32:37.931Z","avatar_url":"https://github.com/osteele.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terminal-codes-to-html\n\nConvert text that contains [ANSI/VT100 color terminal\ncodes](https://wiki.bash-hackers.org/scripting/terminalcodes) to HTML or plain\ntext.\n\n## History and Status\n\nThis package implements enough functionality to convert colored syntax error\noutput from [esprima](https://esprima.org/index.html), into HTML that can be\ndisplayed in a web page.\n\nIt was developed for use in\n[osteele/p5-server](https://github.com/osteele/p5-server). That package now uses\n[`@babel/parser](https://babel.dev/docs/en/babel-parser) instead of Esprima, so\nit no longer uses this code.\n\n## Install\n\n```sh\nnpm install --save-dev terminal-codes-to-html\n```\n\n```sh\nyarn add -D terminal-codes-to-html\n```\n\n## Usage\n\n### Convert codes to HTML\n\n```js\nimport { terminalCodesToHtml } from \"terminal-codes-to-html\";\n\nconst html = terminalCodesToHtml(\n        \"\\x1b[0m \\x1b[90m 5 |\\x1b[39m \\x1b[36mfunction\\x1b[39m draw() {\\x1b[0m\"\n      );\n// =\u003e\n`  5 | \u003cspan style=\"color: cyan\"\u003efunction\u003c/span\u003e draw() {`\n```\n\n### Remove terminal codes\n\n```js\nimport { removeTerminalCodes } from \"terminal-codes-to-html\";\n\nconst text = removeTerminalCodes(\n        \"\\x1b[0m \\x1b[90m 5 |\\x1b[39m \\x1b[36mfunction\\x1b[39m draw() {\\x1b[0m\"\n      );\n// =\u003e\n`  5 | function draw() {`\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosteele%2Fterminal-codes-to-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosteele%2Fterminal-codes-to-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosteele%2Fterminal-codes-to-html/lists"}