ansi-colors
Collection of ansi colors and styles.
Install
Install with npm
$ npm i ansi-colors --save
Usage
var colors = require('ansi-colors');
API
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
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'));
Related projects
- ansi-bgblack: The color bgblack, in ansi. | homepage
- ansi-bgblue: The color bgblue, in ansi. | homepage
- ansi-bgcyan: The color bgcyan, in ansi. | homepage
- ansi-bggreen: The color bggreen, in ansi. | homepage
- ansi-bgmagenta: The color bgmagenta, in ansi. | homepage
- ansi-bgred: The color bgred, in ansi. | homepage
- ansi-bgwhite: The color bgwhite, in ansi. | homepage
- ansi-bgyellow: The color bgyellow, in ansi. | homepage
- ansi-black: The color black, in ansi. | homepage
- ansi-blue: The color blue, in ansi. | homepage
- ansi-bold: The color bold, in ansi. | homepage
- ansi-cyan: The color cyan, in ansi. | homepage
- ansi-dim: The color dim, in ansi. | homepage
- ansi-gray: The color gray, in ansi. | homepage
- ansi-green: The color green, in ansi. | homepage
- ansi-grey: The color grey, in ansi. | homepage
- ansi-hidden: The color hidden, in ansi. | homepage
- ansi-inverse: The color inverse, in ansi. | homepage
- ansi-italic: The color italic, in ansi. | homepage
- ansi-magenta: The color magenta, in ansi. | homepage
- ansi-red: The color red, in ansi. | homepage
- ansi-reset: The color reset, in ansi. | homepage
- ansi-strikethrough: The color strikethrough, in ansi. | homepage
- ansi-underline: The color underline, in ansi. | homepage
- ansi-white: The color white, in ansi. | homepage
- ansi-yellow: The color yellow, in ansi. | homepage
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.