shiki-renderer-hast
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

shiki-renderer-hast

hast renderer for Shiki

Installation

npm install shiki-renderer-hast

Usage

import shiki from 'shiki'
import { codeToHast } from 'shiki-renderer-hast'
;(async () => {
  const highlighter = await shiki.getHighlighter({
    theme: 'nord',
  })

  const code = fs.readFileSync('gen-hast.js', 'utf-8')

  const tree = codeToHast(highlighter, code, 'js')

  // work with tree...
})()

Readme

Keywords

Package Sidebar

Install

npm i shiki-renderer-hast

Weekly Downloads

63

Version

1.1.5

License

MIT

Unpacked Size

7.89 kB

Total Files

5

Last publish

Collaborators

  • sachinraja