1.1.3 • Published 7 months ago

chalk-tags v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Chalk Tags

This is a collection of functions that allows parsing HTML-style color tags.

import { parseTags, stopTagParsing, resumeTagParsing, applyTagsToConsole } from "chalk-tags";

console.log(parseTags("<red>Red text</red> Normal Text")); // (In red)Red text(In white) Normal Text

stopTagParsing();
console.log(parseTags("<red>Red text</red> Normal Text")); // <red>Red text</red> Normal Text

resumeTagParsing();
console.log(parseTags("<red>Red text</red> Normal Text")); // (In red)Red text(In white) Normal Text

console.log("<red>Red text</red> Normal Text"); // <red>Red text</red> Normal Text
applyTagsToConsole();
console.log("<red>Red text</red> Normal Text"); // (In red)Red text(In white) Normal Text

// Output is what you would expect.
console.log("<red bg:blue bold>Red and bold on blue background</bg> Red and Bold</bold> Red</red>");
console.log("<#FF0000 bg:#0000FF>Red on blue background</> White on black background");

// Look in the documentation for `parseTags` for a more detailed explanation and a list of the tags.

The npm package is here. Made with chalk ❤️

1.1.3

7 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago