npm.io
0.1.7 • Published 1 week ago

@git-diff-view/lowlight

Licence
MIT
Version
0.1.7
Deps
3
Size
344 kB
Vulns
0
Weekly
0
Stars
726

@git-diff-view/lowlight

Built-in syntax highlighter for @git-diff-view using lowlight

npm version npm downloads

This package is the default syntax highlighter built into @git-diff-view/core. It uses lowlight (highlight.js wrapper) for syntax highlighting.

Features

  • Built into @git-diff-view/core by default
  • No additional installation required
  • Based on highlight.js
  • Supports 190+ languages
  • Fast and lightweight
  • Works in browser and Node.js

Usage

No explicit setup needed - it's automatically used by @git-diff-view/core:

import { DiffFile } from "@git-diff-view/core";

const file = new DiffFile(/* ... */);
file.init();  // Automatically uses lowlight for syntax highlighting

When to Use

This is the default highlighter and suitable for most use cases. Consider @git-diff-view/shiki if you need:

  • More accurate syntax highlighting
  • VSCode-compatible themes
  • Better language grammar support

License

MIT MrWangJustToDo

Keywords