Collection of ansi colors and styles.
Install
Install with npm:
$ npm install --save ansi-colors
Usage
This module exports an object of functions. Each function wraps a string with the ansi codes used to display the string with that color (or style). Use the wrapped string with console.log
:
var colors = require('ansi-colors');
console.log(colors.bold(colors.cyan('[info]')), colors.cyan('This is some information'));
console.log(colors.bold(colors.yellow('[warning]')), colors.yellow('This is a warning'));
console.error(colors.bold(colors.red('[ERROR]')), colors.red('Danger! There was an error!'));
Example
See the example for more colors and styles.
About
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-wrap: Create ansi colors by passing the open and close codes. | homepage
- ansi-yellow: The color yellow, in ansi. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Building docs
(This project‘s readme.md is generated by verb, please don’t edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Author
Brian Woodward
License
Copyright © 2018, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on January 12, 2018.