ansi-styles / 1.1.0 last updated a year ago created on Jul 31st 2013

Install

npm install --save ansi-styles

Clone

git clone git@github.com:sindresorhus/ansi-styles.git

dependencies

No dependencies listed.

maintainers

sindresorhus sindresorhus
jbnicolai

versions 6 total

1.1.0 a year ago sindresorhus
1.0.0 2 years ago sindresorhus
0.2.0 2 years ago sindresorhus
0.1.2 2 years ago sindresorhus
0.1.1 2 years ago sindresorhus
0.1.0 2 years ago sindresorhus
498701 Downloads yesterday.

readme

ansi-styles Build Status

ANSI escape codes for styling strings in the terminal

You probably want the higher-level chalk module for styling your strings.

screenshot

Install

$ npm install --save ansi-styles

Usage

1
2
3
var ansi = require('ansi-styles');

console.log(ansi.green.open + 'Hello world!' + ansi.green.close);

API

Each style has an open and close property.

Styles

General

  • reset
  • bold
  • dim
  • italic (not widely supported)
  • underline
  • inverse
  • hidden
  • strikethrough (not widely supported)

Text colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • gray

Background colors

  • bgBlack
  • bgRed
  • bgGreen
  • bgYellow
  • bgBlue
  • bgMagenta
  • bgCyan
  • bgWhite

License

MIT © Sindre Sorhus

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.