 _ = require 'lodash'
 { clearLine, cursorTo } = require 'readline'
-{ stripColor } = require 'chalk'
 { inspect } = require 'util'
 
+{ getNonOcuppyingLength } = require './utils'
 styler = require './styler'
-
-module.exports = @
 
 # Alias
 { stdout, stderr } = process

MINIMUM_COLS = 15

# Private methods
getNonOcuppyingLength = (str) -> str.length - stripColor(str).length

tag = (txt, style, tagString) -> style(_.padEnd(txt, LEFT_MARGIN)) + tagString


# Exposed methods
@write = (str, stream = stdout) => stream.write str; @

@endLine = (stream = stdout) => stream.write "\n"; @openUpdate = no; @

@eraseLine = (stream = stdout) => clearLine(stream); cursorTo(stream, 0); @

