Package Exports
- bbcode-to-ansi
- bbcode-to-ansi/bbcode-to-ansi.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bbcode-to-ansi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bbcode-to-ansi
BBCode to ANSI parser. Created specifically for Godot external debuggers to support print_rich() terminal output. Project based on https://github.com/Calinou/godot-bbcode-to-ansi
Install
npm install bbcode-to-ansi
Usage
import BBCodeToAnsi from 'bbcode-to-ansi';
const bbcodeParser = new BBCodeToAnsi();
const bbcOutput = '[b][color=fuchsia]Colorful text output![/color][b]';
bbcodeParser.parse(bbcOutput);
// \u001b[1m\u001b[38;2;255;0;255mColorful text output\u001b[39m\u001b[22m- Supports hexidecimal coloring
- Supports all 140 standard named colors with or without underscores in name
Limitations
- Output terminal must support 24bit true color for all BBCode color options.
- Only the following tags are supported
biusindentcodecenterrighturlcolorbgcolorfgcolor centerandrighttags are emulated with spaces. May not be accurate depending on terminal size.