CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
README.md54 linesDownload Raw Back to kolorist
1# kolorist2 3Tiny library to put colors into stdin/stdout :tada:4 5![Screenshot of terminal colors](.github/demo.png)6 7## Usage8 9```bash10npm install --save-dev kolorist11```12 13```js14import { red, cyan } from 'kolorist';15 16console.log(red(`Error: something failed in ${cyan('my-file.js')}.`));17```18 19You can also disable or enable colors globally via the following environment variables:20 21- disable:22  - `NODE_DISABLE_COLORS`23  - `NO_COLOR`24  - `TERM=dumb`25  - `FORCE_COLOR=0`26 27- enable:28  - `FORCE_COLOR=1`29  - `FORCE_COLOR=2`30  - `FORCE_COLOR=3`31 32On top of that you can disable colors right from node:33 34```js35import { options, red } from 'kolorist';36 37options.enabled = false;38console.log(red('foo'));39// Logs a string without colors40```41 42You can also strip colors from a string:43 44```js45import { red, stripColors } from 'kolorist';46 47console.log(stripColors(red('foo')));48// Logs 'foo'49```50 51### License52 53`MIT`, see [the license file](./LICENSE).54 
basant307/AI_Governance_Project · CoolFace