Skip to content

Instantly share code, notes, and snippets.

@rudyjahchan
Created February 3, 2014 08:36
Show Gist options
  • Save rudyjahchan/8780568 to your computer and use it in GitHub Desktop.
Save rudyjahchan/8780568 to your computer and use it in GitHub Desktop.
module.exports.setForegroundColor = (color)->
process.stdout.write "\x1b[3#{color}m"
module.exports.setBackgroundColor = (color)->
process.stdout.write "\x1b[4#{color}m"
module.exports.moveTo = (x, y) ->
{ x, y } = transform(x,y)
process.stdout.write "\x1b[#{y};#{x}f"
module.exports.resetColors = ->
process.stdout.write '\x1b[39;49m'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment