ansi-escapes.cr travis build

ANSI escape codes for manipulating the terminal.

A copycat of ansi-escapes for javascript by @sindresorhus. Thank you!

Installation

Add this to your application's shard.yml:

dependencies:
  ansi-escapes:
    github: gtramontina/ansi-escapes.cr

Usage

require "ansi-escapes"

# move the cursor two rows up and to the left
puts "#{AnsiEscapes::Cursor.up(2)}#{AnsiEscapes::Cursor::LEFT}HI!" # => "\u001b[2A\u001b[1000DHI!"

You might want to include AnsiEscapes so your code reads a little better:

require "ansi-escapes"
include AnsiEscapes

# move the cursor two rows up and to the left
puts "#{Cursor.up(2)}#{Cursor::LEFT}HI!" # => "\u001b[2A\u001b[1000DHI!"

API

Contributing

  1. Fork it ( https://github.com/gtramontina/ansi-escapes.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request