chalk-box alternatives and similar shards
Based on the "Misc" category.
Alternatively, view chalk-box alternatives based on common mentions on social networks and blogs.
-
sentry
Build/Runs your crystal application, watches files, and rebuilds/restarts app on file changes -
immutable
Thread-safe, persistent, immutable collections for the Crystal language -
crystagiri
An Html parser library for Crystal (like Nokogiri for Ruby) -
crz
Functional programming library for https://github.com/crystal-lang/crystal -
crystal-web-framework-stars
⭐️ Web frameworks for Crystal, most starred on Github -
crystal-futures
Future type implementation for Crystal language -
cron_scheduler
Simple job scheduler with crontab patterns for Crystal Language. -
inflector.cr
Inflector shard for Crystal. A port of ActiveSupport::Inflector -
aasm.cr
:arrows_clockwise: Easy to use finite state machine for Crystal classes -
kreal
Kreal is a model sharing & RPC library built on and works with Kemal seamlessly. -
retriable.cr
Retriable.cr is a simple DSL to retry failed code blocks -
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal -
CrSerializer
Extensible annotation based serialization/deserialization library -
circuit_breaker
Implementation of the circuit breaker pattern in crystal -
burocracia.cr
👔 Zero-dependency Crystal shard to validate, generate and format Brazilian burocracias (CPF, CNPJ, CEP) -
wikicr
Wiki in crystal, using Markdown and Git, inspired by dokuwiki. Last features to build are pretty hard, if you have some time to help... :) -
m3u8
Generate and parse m3u8 playlists for HTTP Live Streaming (HLS) in Crystal. -
message_verifier.cr
Rails compatible MessageVerifier for Crystal-lang apps -
defined
This shard provides facilities for checking whether a constant exists at compile time, and for a variety of different conditional compilation options. Code can be conditionally compiled based on the existence of a constant, version number constraints, or whether an environment variable is set truthy or not.
WorkOS - The modern identity platform for B2B SaaS
Do you think we are missing an alternative of chalk-box or a related project?
README
Chalk Box
Terminal toolbox to paint and embroider :)
Why
Colorize is the obvious choice for those who are starting coding on Crystal. However it changes the String class, and that's not a good practice.
Besides that, it doesn't offer ways to handle multiple types of terminal.
Obs: Yes, this lib is similar to the chalk lib from Node.js. The differences are:
- This lib is written in Crystal (oh really?);
- All-in-one (the style and support modules are integrated);
- This lib doesn't support 256 and TrueColor for now.
Installation
Add this to your application's shard.yml
:
dependencies:
chalk_box:
github: azukiapp/crystal-chalk-box
Usage
require "chalk_box"
module Basic
extend ChalkBox
extend self
def main
puts chalk.green("green fields")
end
end
Basic.main
API
chalk.style[.style...](*args)
Example: chalk.red.bold.underline("Hello", "world")
Chain styles and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that chalk.red.yellow.green
is equivalent to chalk.green
.
chalk.enabled
Color support is automatically detected, but you can override it by setting the enabled
property.
For default enable is instance of ChalkBox::Supports
.
ChalkBox::Supports
Detect whether the terminal supports color. Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags --color
and --no-color
. For situations where using --color
is not possible, add an environment variable FORCE_COLOR
with any value to force color. Trumps --no-color
.
Styles
Modifiers
reset
bold
dim
italic
(not widely supported)underline
inverse
hidden
strikethrough
(not widely supported)
Colors
black
red
green
yellow
blue
(on Windows the bright version is used as normal blue is illegible)magenta
cyan
white
gray
Background colors
bgBlack
bgRed
bgGreen
bgYellow
bgBlue
bgMagenta
bgCyan
bgWhite
TODO
- Add examples for
ChalkBox::Styles
; - Add examples for
ChalkBox::Supports
; - Add support for 256 colors;
- Add support for truecolor;
Contributing
- Fork it ( https://github.com/azukiapp/crystal-chalk-box/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- nuxlli Everton Ribeiro - creator, maintainer
License
"Azuki", "azk" and the Azuki logo are copyright (c) 2013-2016 Azuki Serviços de Internet LTDA.
azk source code is released under Apache 2 License.
Check LEGAL and LICENSE files for more information.
*Note that all licence references and agreements mentioned in the chalk-box README section above
are relevant to that project's source code only.