Skip to content

A highlighter built with Shiki for the command line.

Notifications You must be signed in to change notification settings

babakfp/shiki-command-line

Repository files navigation

Shiki Command Line

A highlighter built with Shiki for the command line.

Install

pnpm add shiki-command-line

Usage

import { highlightCode } from "shiki-command-line"

console.log(
    await highlightCode("<div>Hello, World!</div>", {
        lang: "html",
        theme: "github-dark-default",
    }),
)


console.log(
    await highlightCode(
        `body {
    content: "Hello, World!";
}`,
        {
            lang: "css",
            theme: "github-dark-default",
        },
    ),
)


console.log(
    await highlightCode('console.log("Hello, World!")', {
        lang: "js",
        theme: "github-dark-default",
    }),
)

About

A highlighter built with Shiki for the command line.

Resources

Stars

Watchers

Forks