string-color

0.8.0 • Public • Published

String ANSI

A minimalist color extension module for Node.JS.

Extends the String prototype with the function color, which inserts ANSI color codes in place of color string names.

Run node test.js to see a demonstrative list of all possible colors.

Supported Color Codes

  • reset
  • bold
  • italic
  • underline
  • conceal
  • strike
  • reverse
  • blink
  • blink2
  • black
  • red
  • green
  • yellow
  • blue
  • purple
  • cyan
  • white
  • default
  • bgblack
  • bgred
  • bggreen
  • bgyellow
  • bgblue
  • bgpurple
  • bgcyan
  • bgwhite
  • bgdefault

Example Usage

console.log("There has been an error!".color('red', 'bold');

Any number of arguments may be passed to the color method.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.8.0
    1,521
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.8.0
    1,521

Package Sidebar

Install

npm i string-color

Weekly Downloads

1,521

Version

0.8.0

License

none

Last publish

Collaborators

  • yuffster