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