0.0.3 • Published 10 months ago

color-properties v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

color-properties

Extends the String prototype with color and text decoration attributes, allowing for easy styling of console output using ANSI escape codes.

Installation

npm install color-properties

Usage

First, import the colorize function:

const { colorize } = require('color-properties');

Next, run the colorize function to extend the String prototype with color and decoration properties:

colorize();

Alternatively you can also extend the string directly:

require('color-properties/colorize');

Now, you can use the color and decoration properties directly on string instances. Here's an example:

console.log('Hello World!'.green.bright); // prints "Hello World!" in green and bold style

Styles

The following styles are avainable:

  • reset
  • bright
  • dim
  • italic
  • underline
  • inverse
  • hidden
  • strikethrough
  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • gray
  • bgBlack
  • bgRed
  • bgGreen
  • bgYellow
  • bgBlue
  • bgMagenta
  • bgCyan
  • bgWhite
  • bgGray

Refer to the example for combining multiple properties.

License

MIT

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago