Minimalistic terminal coloring library
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
imgs
test
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
dye.js
package.json

README.md

dye

npm status build status dependency status coverage status

Dye is a coloring/styling library for wrapping common ANSI escape sequences around text that produce colors/styling when logged to a terminal.

The interface mostly mirrors the popular colors module on npm, but does not introduce implicit global dependencies in your code via String.prototype, and has been cleaned up for terminal use only.

Usage

Basic usage is simply dye.red(str). All the exported colors with bold (aka bright) variants should work everywhere. Here we test all the methods in both variants.

var dye = require('dye');
var cols = ['white', 'black', 'grey', 'blue', 'cyan', 'green', 'magenta', 'red','yellow'];
cols.forEach(function (col) {
  var colored = dye[col](col);
  console.log(colored);
  console.log(dye.bold(colored));
});

example output!

Experimental

The inverse, underline, italic functions have sparse support (no worky on windows).

Installation

$ npm install dye

License

MIT-Licensed. See LICENSE file for details.