🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

codemirror-lang-hcl

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror-lang-hcl

hcl language support for CodeMirror

0.1.0
latest
npm
Version published
Weekly downloads
23K
-17.63%
Maintainers
1
Weekly downloads
 
Created
Source

codemirror-lang-hcl

NPM Version

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

The lezer grammar is ported from tree-sitter-hcl.

Getting Started

Installation

npm i codemirror-lang-hcl

Usage

import {EditorView} from '@codemirror/view';
import {EditorState} from '@codemirror/state';
import {hcl} from "codemirror-lang-hcl";

const state = EditorState.create({
	doc: 'my hcl code',
	extensions: [
		hcl(),
	]
});

const view = new EditorView({
	parent: document.querySelector('#editor'),
	state
});

Example

This example is from tree-sitter-hcl.

Theme: https://thememirror.net/tomorrow.

example.png

FAQs

Package last updated on 14 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts