Skip to content

chalk/chalk-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 18, 2023
e699de5 · Mar 18, 2023

History

46 Commits
Sep 14, 2021
Jun 20, 2017
Oct 7, 2018
Oct 7, 2018
Oct 7, 2018
Sep 17, 2021
Mar 18, 2023
Sep 14, 2021
Mar 18, 2023
Mar 18, 2023
Jul 1, 2015
Sep 27, 2021
Sep 27, 2021
Sep 27, 2021

Repository files navigation

chalk-cli Downloads run on repl.it

Terminal string styling done right

Install

npm install --global chalk-cli

Usage

$ chalk --help

  Usage
    $ chalk <style> ... <string>
    $ echo <string> | chalk <style> ...

  Options
    --template, -t    Style template. The `~` character negates the style.
    --stdin           Read input from stdin rather than from arguments.
    --no-newline, -n  Don't emit a newline (`\n`) after the input.
    --demo            Demo of all Chalk styles.

  Examples
    $ chalk red bold 'Unicorns & Rainbows'
    $ chalk -t '{red.bold Unicorns & Rainbows}'
    $ chalk -t '{red.bold Dungeons and Dragons {~bold.blue (with added fairies)}}'
    $ echo 'Unicorns from stdin' | chalk --stdin red bold

See supported styles.

Template syntax

  • {red.bold unicorn}
  • {red.bold unicorns} are {blue FUN!!!}
  • {red.bold unicorn {blue.underline dancing}}
  • {red red {~red normal}}
  • {red hey\} still red} not red
  • {red hey\\} not red

Related

  • chalk - API for this module

Maintainers