monaco-json5-highlighter
v0.1.2
Published
JSON5 language registration and syntax highlighting for Monaco Editor.
Downloads
21
Maintainers
Readme
monaco-json5-highlighter
monaco-json5-highlighter is a lightweight library for Monaco Editor designed to register and provide syntax highlighting for JSON5. With this library, developers can easily register the JSON5 language in Monaco Editor and enable syntax highlighting to enhance code readability and editing experience.
Installation
npm install monaco-json5-highlighter
pnpm install monaco-json5-highlighter
yarn add monaco-json5-highlighter
Usage
- Import the library and register the JSON5 language
import * as monaco from "monaco-editor";
import { registerJson5Language } from "monaco-json5-highlighter";
// Register the JSON5 language and apply syntax highlighting
registerJson5Language(monaco);
- Create an editor instance with language set to
json5
monaco.editor.create(..., {
value: "// Your JSON5 content here",
language: "json5",
...
});