📟 Functional CLI ANSI formatter.
This package can be installed as a dependency or used directly.
🦕 In JS or deno:
import { foregroundRed } from "https://esm.sh/@vangware/ansi";
foregroundRed`Hello world!`;
🌎 Or in the browser:
<script type="module">
import { foregroundRed } from "https://esm.sh/@vangware/ansi";
foregroundRed`Hello world!`;
</script>
First:
# If you use npm
npm install @vangware/ansi
# If you use pnpm
pnpm add @vangware/ansi
# If you use yarn
yarn add @vangware/ansi
And then:
import { whiteText, redBackground, bold, mix } from "@vangware/ansi";
// You can just use the styles
console.log(redBackground`Red background text`);
// Or you can mix them!
const warningText = mix(whiteText, redBackground, bold);
console.log(warningText`Warning!`);
Documentation is available HERE. It is auto-generated with typedoc based on the JSDocs and the types in the source. It shouldn't be necessary to read this. Code editors like VS Code integrate the documentation in the UI.
Changelog can be found HERE.
Test coverage can be found HERE.