@treelight/typescript
v0.6.0
Published
Treelight language module for typescript.
Maintainers
Readme
@treelight/typescript
TypeScript language definition for Treelight.
Install
npm install @treelight/core @treelight/typescript @treelight/theme-github-darkUsage
import { Highlighter } from '@treelight/core';
import typescript from '@treelight/typescript';
import githubDark from '@treelight/theme-github-dark';
const highlighter = await Highlighter.create({
languages: [typescript],
themes: [githubDark],
theme: 'github-dark',
});
const html = highlighter.highlight('const message: string = "Hello World!";', 'typescript');This package includes the Tree-sitter grammar WASM and highlight queries for TypeScript.
See the Treelight README for full usage.
