6.0.1 • Published 4 months ago

@cocacola89/codemirror-lang-jsonc v6.0.1

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

@codemirror/lang-json NPM version

[ WEBSITE | ISSUES | FORUM | CHANGELOG ]

This package implements JSONC language support for the CodeMirror code editor.

The project page has more information, a number of examples and the documentation.

This code is released under an MIT license.

We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.

Thanks to marijnh and SirPepe for their contributions that made this fork possible.

Usage

import {EditorView, basicSetup} from "codemirror"
import {jsonc} from "@cocacola89/codemirror-lang-json"

const view = new EditorView({
  parent: document.body,
  doc: `{"version": "9.99.99", /* comment */ "data": [1, 2, 3]}`,
  extensions: [basicSetup, jsonc()]
})

API Reference

  • jsonc() → LanguageSupport\ JSONC language support.
  • jsoncLanguage: LRLanguage\ A language provider that provides JSON parsing.