Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divanvisagie/nocol
A simple C program that strips the colour from streamed output
https://github.com/divanvisagie/nocol
Last synced: 12 days ago
JSON representation
A simple C program that strips the colour from streamed output
- Host: GitHub
- URL: https://github.com/divanvisagie/nocol
- Owner: divanvisagie
- License: gpl-2.0
- Created: 2024-06-20T18:00:41.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-06-21T15:33:00.000Z (5 months ago)
- Last Synced: 2024-06-22T12:08:27.856Z (5 months ago)
- Language: C
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# nocol
**nocol** is a command-line tool designed to stream text output from commands, stripping away any embedded ANSI colour codes. Unlike other tools like `ansi2txt`, **nocol** streams logs instantly, avoiding the long pauses typical of tools that buffer before writing to `tee` or other destinations. This makes **nocol** perfect for scenarios where you need real-time log processing, such as piping logs from a Node.js service into a log file in `/tmp` for easier searching within NeoVim. It's particularly handy for use with program runners like Cargo or Yarn, which produce coloured log outputs.
## Installation
### From Binary
Download the latest binary for your platform [here](https://github.com/divanvisagie/nocol/releases).
### Install via Homebrew
If you haven't added the tap yet, do so with:
```sh
brew tap divanvisagie/homebrew-tap
```Then, install **nocol** with:
```sh
brew install nocol
```## Usage
| Command Example | Description |
|---------------------------------|----------------------------------------------------|
| `echo 'hello' \| lolcat \| nocol` | Strips colours from the output of `lolcat`. |
| `ifconfig \| nocol` | Strips colours from the output of `ifconfig`. |
| `cat colorfulfile.txt \| nocol` | Strips colours from the contents of a file. |By using **nocol**, you ensure that your log files are clean and easily searchable, while benefiting from instant streaming without the delays experienced with other colour-stripping tools.