Module

Choku.Stdout

Package
purescript-choku
Repository
m15a/purescript-choku

Chalk in Effect, for the STDOUT stream.

The default chalk instance automatically detects the level of color support in the environment, either STDOUT or STDERR. This module provides the default chalk instance for the STDOUT stream. For the STDERR stream, use the module Choku.Stderr.

NOTE: You can force the color support level via environment variable $FORCE_COLOR.

See also

#choku Source

choku :: Effect Choku

Get the default chalk instance for STDOUT, automatically detecting the level of color support.

#supportsColor Source

supportsColor :: Effect { has16m :: Boolean, has256 :: Boolean, hasBasic :: Boolean, level :: Int }

Provide detailed information of the color support level.

See https://github.com/chalk/chalk#supportscolor.

#withStyle Source

withStyle :: String -> Style -> Effect String

Modify a string, using the default chalk for STDOUT, with the given style.

For example,

import Prelude
import Effect.Console
import Choku

log =<< "hello" `withStyle` (inverse >>> underline)

prints an inversed and underlined "hello" string.

#(&:) Source

Operator alias for Choku.Stdout.withStyle (non-associative / precedence 7)

#(:&) Source

Operator alias for Choku.Stdout.withStyleFlipped (non-associative / precedence 7)