JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53139721
  • Score
    100M100P100Q264476F
  • License MIT

Collection of ansi colors and styles.

Package Exports

  • ansi-colors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ansi-colors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ansi-colors NPM version

Collection of ansi colors and styles.

Install

Install with npm

$ npm i ansi-colors --save

Usage

var colors = require('ansi-colors');

API

bgblack

Wrap a string with ansi codes to create a black background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgblack('some string'));

bgblue

Wrap a string with ansi codes to create a blue background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgblue('some string'));

bgcyan

Wrap a string with ansi codes to create a cyan background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgcyan('some string'));

bggreen

Wrap a string with ansi codes to create a green background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bggreen('some string'));

bgmagenta

Wrap a string with ansi codes to create a magenta background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgmagenta('some string'));

bgred

Wrap a string with ansi codes to create a red background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgred('some string'));

bgwhite

Wrap a string with ansi codes to create a white background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgwhite('some string'));

bgyellow

Wrap a string with ansi codes to create a yellow background.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bgyellow('some string'));

black

Wrap a string with ansi codes to create black text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.black('some string'));

blue

Wrap a string with ansi codes to create blue text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.blue('some string'));

bold

Wrap a string with ansi codes to create bold text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.bold('some string'));

cyan

Wrap a string with ansi codes to create cyan text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.cyan('some string'));

dim

Wrap a string with ansi codes to create dim text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.dim('some string'));

gray

Wrap a string with ansi codes to create gray text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.gray('some string'));

green

Wrap a string with ansi codes to create green text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.green('some string'));

grey

Wrap a string with ansi codes to create grey text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.grey('some string'));

hidden

Wrap a string with ansi codes to create hidden text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.hidden('some string'));

inverse

Wrap a string with ansi codes to create inverse text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.inverse('some string'));

italic

Wrap a string with ansi codes to create italic text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.italic('some string'));

magenta

Wrap a string with ansi codes to create magenta text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.magenta('some string'));

red

Wrap a string with ansi codes to create red text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.red('some string'));

reset

Wrap a string with ansi codes to reset ansi colors currently on the string.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.reset('some string'));

strikethrough

Wrap a string with ansi codes to add a strikethrough to the text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.strikethrough('some string'));

underline

Wrap a string with ansi codes to underline the text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.underline('some string'));

white

Wrap a string with ansi codes to create white text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.white('some string'));

yellow

Wrap a string with ansi codes to create yellow text.

Params

  • str {String}: String to wrap with ansi codes.
  • returns {String}: Wrapped string

Example

console.log(colors.yellow('some string'));

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Brian Woodward

License

Copyright © 2015 Brian Woodward Released under the MIT license.


This file was generated by verb-cli on November 30, 2015.