@cakecatz/ansi-parser
v1.0.3
Published
Parser for string that include ansi codes.
Downloads
2
Readme
ansi-parser
Parser for string that include ansi codes.
Install
npm i @cakecatz/ansi-parser
Usage
const { parseAnsi } = require("@cakecatz/ansi-parser");
const cells = parseAnsi("\u001b[31mhello\u001b[39m");
cells
will be like this.
[
{
bg: 0, // COLOR_CODES.BLACK
fg: 1, // COLOR_CODES.RED
content: "hello",
bold: false,
dim: false,
inverse: false,
italic: false,
underline: false
}
];