0.1.2 • Published 8 months ago

monaco-json5-highlighter v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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.

Screenshot of JSON5 syntax highlighting

Installation

npm install monaco-json5-highlighter
pnpm install monaco-json5-highlighter
yarn add monaco-json5-highlighter

Usage

  1. 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);
  1. Create an editor instance with language set to json5
monaco.editor.create(..., {
  value: "// Your JSON5 content here",
  language: "json5",
  ...
});
0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago