Skip to content

Repository files navigation

dye

npm statusbuild statusdependency statuscoverage 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.

vardye=require('dye');varcols=['white','black','grey','blue','cyan','green','magenta','red','yellow'];cols.forEach(function(col){varcolored=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.

About

Minimalistic terminal coloring library

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages