https://github.com/kojix2/lolcat.cr
Crystal implementation of the lolcat
https://github.com/kojix2/lolcat.cr
crystal crystal-lang crystal-language lolcat
Last synced: 7 months ago
JSON representation
Crystal implementation of the lolcat
- Host: GitHub
- URL: https://github.com/kojix2/lolcat.cr
- Owner: kojix2
- License: bsd-3-clause
- Created: 2024-11-20T08:17:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-19T06:28:03.000Z (7 months ago)
- Last Synced: 2025-08-19T08:39:14.642Z (7 months ago)
- Topics: crystal, crystal-lang, crystal-language, lolcat
- Language: Crystal
- Homepage: https://kojix2.github.io/lolcat.cr/
- Size: 199 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
What?
---
[](https://github.com/kojix2/lolcat.cr/actions/workflows/build.yml)
[](https://tokei.kojix2.net/github/kojix2/lolcat.cr)
:black_cat: Crystal implementation of the [lolcat](https://github.com/busyloop/lolcat)
## Installation
Download from [GitHub Release](https://github.com/kojix2/lolcat.cr/releases)
From source code:
```sh
git clone https://github.com/kojix2/lolcat.cr
cd lolcat.cr
shards build --release
mv bin/lolcat /usr/local/bin/ # or any directory in your PATH
```
Homebrew:
```sh
brew install kojix2/brew/lolcat
```
## Usage
```sh
lolcat README.md
```
```sh
lolcat --help
```
As a library
You can use lolcat.cr as a library in your Crystal projects:
```yaml
# Add to your shard.yml
dependencies:
lolcat:
github: kojix2/lolcat.cr
```
Basic usage:
```crystal
require "lolcat"
# Use the Lol module directly
include Lolcat::Lol
# Create options with default values
options = Lolcat::Options.new
# Apply rainbow colors to a string
colored_text = rainbow_line("Hello, colorful world!", options, 0.0)
puts colored_text
# Or process an entire IO stream
io = IO::Memory.new("Multiple\nLines\nOf\nText")
lol_cat(io, options)
```
For more examples, see [examples](examples/)
## Development
This project was created as an example of a command line tool.
Use only standard libraries and keep it simple.
## Contributing
Pull requests and issues are welcome.
## License
The original lolcat is licensed under the BSD 3-Clause "New" or "Revised" License.
Thus, the same is true for this project.