1.1.4 • Published 1 year ago

tick-log v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This is an ultra-lightweight, pure javascript library which gives colored log data for both node and browser.

If output is not TTY colors are suppressed so that the logs can still be human readable.

Installation

yarn add tick-log

Usage

const tickLog = require('tick-log');
tickLog.start('This is the START log message');
tickLog.info('This is the INFO log message');
tickLog.success('This is the SUCCESS log message');
tickLog.error('This is the ERROR log message');

API

NameDescription
startUses yellow label when the output is TTY
infoUses blue label when the output is TTY
successUses green label when the output is TTY
errorUses red background label when the output is TTY
forceColorWhen the output is not TTY, pass true to still use the coloring. (For browsers coloring still will not apply.)

Common paraters

NameDescription
textThe text to be printed
useProcessStdoutWriteIn some cases console.log output is badly formatted (like using console.log within jest).For such cases you can ask to use process.stdout.write. If process.stdout does not exist this flag is ignored. (Defaults to false)

License

The license is MIT and full text here.

Used Modules

None