![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | dist/ | a year ago | - | |
![]() | LICENSE | a year ago | 1.1K | |
![]() | README.md | a year ago | 939 | 595aea1 more query options + view options [كارل مبارك] |
![]() | package.json | a year ago | 1.2K | afd0ccc remove unused [كارل مبارك] |
Tiny library to put colors into stdin/stdout :tada:
npm install --save-dev kolorist
import { red, cyan } from 'kolorist';
console.log(red(`Error: something failed in ${cyan('my-file.js')}.`));
You can also disable or enable colors globally via the following environment variables:
disable:
NODE_DISABLE_COLORS
NO_COLOR
TERM=dumb
FORCE_COLOR=0
enable:
FORCE_COLOR=1
FORCE_COLOR=2
FORCE_COLOR=3
On top of that you can disable colors right from node:
import { options, red } from 'kolorist';
options.enabled = false;
console.log(red('foo'));
// Logs a string without colors
You can also strip colors from a string:
import { red, stripColors } from 'kolorist';
console.log(stripColors(red('foo')));
// Logs 'foo'
MIT
, see the license file.