{"id":16752697,"url":"https://github.com/luser/strip-ansi-escapes","last_synced_at":"2025-05-16T11:05:58.306Z","repository":{"id":29005643,"uuid":"119863860","full_name":"luser/strip-ansi-escapes","owner":"luser","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-14T15:44:21.000Z","size":28,"stargazers_count":42,"open_issues_count":3,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T08:17:25.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2018-02-01T16:42:02.000Z","updated_at":"2025-03-23T08:27:28.000Z","dependencies_parsed_at":"2024-06-19T01:42:30.850Z","dependency_job_id":"6713d364-0121-478d-9049-455ac8a42cb8","html_url":"https://github.com/luser/strip-ansi-escapes","commit_stats":{"total_commits":21,"total_committers":6,"mean_commits":3.5,"dds":"0.33333333333333337","last_synced_commit":"830038d2e7bc0683007d4d90da7bbd0d3c1d6fd7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luser%2Fstrip-ansi-escapes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luser%2Fstrip-ansi-escapes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luser%2Fstrip-ansi-escapes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luser%2Fstrip-ansi-escapes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luser","download_url":"https://codeload.github.com/luser/strip-ansi-escapes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254021795,"owners_count":22000999,"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":"2024-10-13T02:47:51.486Z","updated_at":"2025-05-16T11:05:53.297Z","avatar_url":"https://github.com/luser.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Continuous integration](https://github.com/luser/strip-ansi-escapes/workflows/Continuous%20integration/badge.svg)  [![crates.io](https://img.shields.io/crates/v/strip-ansi-escapes.svg)](https://crates.io/crates/strip-ansi-escapes) [![](https://docs.rs/strip-ansi-escapes/badge.svg)](https://docs.rs/strip-ansi-escapes)\n\nA crate for stripping ANSI escape sequences from byte sequences.\n\nThis can be used to take output from a program that includes escape sequences and write\nit somewhere that does not easily support them, such as a log file.\n\n# Examples\n\nThe `strip` function accepts bytes and returns a `Vec` of bytes with ANSI escape sequences removed.\n\n```rust\nextern crate strip_ansi_escapes;\n\nuse std::io::{self, Write};\n\nfn work() -\u003e io::Result\u003c()\u003e {\n  let bytes_with_colors = b\"\\x1b[32mfoo\\x1b[m bar\";\n  let plain_bytes = strip_ansi_escapes::strip(\u0026bytes_with_colors);\n  io::stdout().write_all(\u0026plain_bytes)?;\n  Ok(())\n}\n\nfn main() {\n    work().unwrap();\n}\n```\n\nFor writing directly to a writer, the `Writer` struct may be preferable.\n\n```rust\nextern crate strip_ansi_escapes;\n\nuse std::io::{self, Write};\nuse strip_ansi_escapes::Writer;\n\nfn work() -\u003e io::Result\u003c()\u003e {\n  let bytes_with_colors = b\"\\x1b[32mfoo\\x1b[m bar\";\n  let mut writer = Writer::new(io::stdout());\n  // Only `foo bar` will be written to stdout\n  writer.write_all(bytes_with_colors)?;\n  Ok(())\n}\n\nfn main() {\n    work().unwrap();\n}\n```\n\n# License\n\nLicensed under either of\n\n  * Apache License, Version 2.0 ([`LICENSE-APACHE`](./LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n  * MIT license ([`LICENSE-MIT`](./LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluser%2Fstrip-ansi-escapes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluser%2Fstrip-ansi-escapes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluser%2Fstrip-ansi-escapes/lists"}