{"id":25879492,"url":"https://github.com/sitkevij/no_color","last_synced_at":"2025-03-02T13:18:51.692Z","repository":{"id":56186925,"uuid":"314620752","full_name":"sitkevij/no_color","owner":"sitkevij","description":"🦀 rust crate library to detect NO_COLOR","archived":false,"fork":false,"pushed_at":"2025-02-13T05:11:36.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-13T05:19:37.044Z","etag":null,"topics":["cli","no-color","rust","rust-crate","rust-library","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sitkevij.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":"2020-11-20T17:14:56.000Z","updated_at":"2025-02-13T05:11:40.000Z","dependencies_parsed_at":"2022-08-15T14:20:22.126Z","dependency_job_id":null,"html_url":"https://github.com/sitkevij/no_color","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fno_color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fno_color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fno_color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitkevij%2Fno_color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitkevij","download_url":"https://codeload.github.com/sitkevij/no_color/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241091374,"owners_count":19908116,"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":["cli","no-color","rust","rust-crate","rust-library","terminal"],"created_at":"2025-03-02T13:18:51.098Z","updated_at":"2025-03-02T13:18:51.683Z","avatar_url":"https://github.com/sitkevij.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# no_color\n\n**no_color** is a zero dependency rust library for NO_COLOR environment variable detection.\n\n[![Crates.io](https://img.shields.io/crates/v/no_color?style=flat-square)](https://crates.io/crates/no_color)\n[![Crates.io](https://img.shields.io/crates/d/no_color?style=flat-square)](https://crates.io/crates/no_color)\n[![GitHub repo size](https://img.shields.io/github/repo-size/sitkevij/no_color)](https://github.com/sitkevij/no_color)\n[![main](https://github.com/sitkevij/no_color/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sitkevij/no_color/actions/workflows/ci.yml?branch=main)\n[![docs.rs](https://img.shields.io/docsrs/no_color)](https://docs.rs/no_color/0.2.0/no_color/)\n[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/sitkevij/no_color/blob/main/LICENSE)\n\n## About\n\nFrom [no-color.org](https://no-color.org/):\n\nAn increasing number of command-line software programs output text with ANSI color escape codes by\ndefault. While some developers and users obviously prefer seeing these colors, many users don’t.\nUnfortunately, every new piece of software seems to have a different way of disabling colored text\noutput and some software has no way at all.\n\nAccepting the futility of trying to reverse this trend, an informal standard is hereby proposed:\n\n\u003e All command-line software which outputs text with ANSI color added should check for the presence\n\u003e of a NO_COLOR environment variable that, when present (regardless of its value), prevents the\n\u003e addition of ANSI color.\n\nBy adopting this standard, users that prefer to have plain, non-colored text output can set one\nenvironment variable in their shell to have it automatically affect all supported software.\n\n## Usage\n\nno_color is a library crate which works with [Cargo](http://crates.io).\n\n### Add to Cargo.toml\n\nTo use, add the following to your `Cargo.toml` dependencies section:\n\n```toml\n[dependencies]\nno_color = \"0.2\"\n```\n\nor use cargo add:\n\n```sh\ncargo add no_color\n```\n\n### Implementing Code\n\nSuggested updates to your rust code as below:\n\n- Note as of edition 2018 [extern is not needed](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html)\n  to import a crate.\n\n- See [examples/simple.rs](examples/simple.rs) for reference.\n\n```rust\nextern crate no_color;\n\nuse no_color::*;\n\nfn main() {\n    println!(\n        \"Environment variable NO_COLOR {0} found. Now do something.\",\n        {\n            if is_no_color() {\n                \"is\"\n            } else {\n                \"is NOT\"\n            }\n        }\n    );\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitkevij%2Fno_color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitkevij%2Fno_color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitkevij%2Fno_color/lists"}