chalkie
Chalk for the browser. Useful with xterm.js.
Demo
To see the demo locally, run yarn && yarn start
.
Using chalkie
Include chalkie in your website:
<script src="https://unpkg.com/chalkie@latest"></script>
Then use chalk
from anywhere in your code:
console.log(chalk.red("foo"))
To convert to HTML, you can call AnsiHTML
and pass in a chalk string:
document.body.innerHTML = ansiHTML(chalk.red("foo"));
Example
See the source code of the live demo:
<!-- How to manually create HTML elements from chalk strings --> <!-- How to use chalk with xterm.js -->