Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

anstyle

mirismaili32MIT2.1.3TypeScript support: included

A very simple utility to change colors and styles of command line outputs (logs)

command-line, terminal, CLI, CLI-colors, CLI-colors-and-styles, ANSI-colors, ANSI-colors-and-styles

readme

Anstyle

A very simple utility to change colors and styles of command line outputs (logs)

npm (scoped) install size downloads
license Forks Stars

npm i anstyle

or:

yarn add anstyle

Sample

import {BOLD, BLUE, GREEN, RED, NORMAL, RESET} from 'anstyle'
console.log(`This ${BOLD}is a ${BLUE}rich${NORMAL} and ${RED}colorful ${GREEN}text${RESET}.`)

Prints:

sample-output.png

You can summarize the above:

import {D, B, G, N, R, T} from 'anstyle'
console.log(`This ${D}is a ${B}rich${N} and ${R}colorful ${G}text${T}.`)

API reference

The source is very simple and illustrative. It's your document: main.ts