@benzed/ansi
v1.1.0
Published
Chainable template tag methods for colored console output.
Downloads
3
Readme
@benzed/ansi
Installation
Usage
Decorated console statements with ansi escape codes:
import { grey, bright, bold, inverted } from '@benzed/ansi'
console.log(grey`hello`) // 'hello', but grey
console.log(bright`how`) // 'how', but bright
console.log(bold`are`) // 'are', but bold
console.log(inverted`you`) // you get the idea
Chainable:
import { blue } from '@benzed/ansi'
console.log(dim.blue.italic`words`) // 'words', but dim blue and italic
API Reference
Every exported method has this interface:
interface Ansi {
(strings: TemplateStringsArray, ...values: unknown[]): string
get dim(): Ansi
get bright(): Ansi
get bold(): Ansi
get italic(): Ansi
get underline(): Ansi
get inverted(): Ansi
get red(): Ansi
get blue(): Ansi
get cyan(): Ansi
get black(): Ansi
get green(): Ansi
get white(): Ansi
get yellow(): Ansi
get magenta(): Ansi
}
That's pretty much it!