ansi-to-json
Convert ANSI strings into JSON output.
:cloud: Installation
$ npm i --save ansi-to-json
:clipboard: Example
const ansiToJson = require("ansi-to-json");
console.log(JSON.stringify(ansiToJson("\u001b[38;5;196mHello\u001b[39m \u001b[48;5;226mWorld\u001b[49m"), null, 4));
console.log(JSON.stringify(ansiToJson("\x1b[30mblack\x1b[37mwhite"), null, 4));
:memo: Documentation
ansiToJson(input)
Convert ANSI strings into JSON output.
Params
- String
input
: The input string.
Return
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:moneybag: Donations
Another way to support the development of my open-source modules is
to set up a recurring donation, via Patreon. :rocket:
PayPal donations are appreciated too! Each dollar helps.
Thanks! :heart:
:scroll: License
MIT © Ionică Bizău