Socket
Book a DemoInstallSign in
Socket

@gdquest/codemirror-console

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gdquest/codemirror-console

Setups a Codemirror view to look and behave like a log console.

0.1.2
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
4
Weekly downloads
 
Created
Source

@gdquest/codemirror-console

console() extension

Purpose

This extension setup a Codemirror view to look and behave like a log console.

  • applies codemirror minimalSetup
  • makes the view read-only;
  • automatically snap to the bottom of the feed (unless scrolled);
  • line wraps content.

Usage

import { EditorView } from "@codemirror/view";
import { console } from "@gdquest/codemirror-console";

new EditorView({
  extensions: [console()],
});

consoleErrorLine() helper

Purpose

This function highlights a line by adding the .cm-console-error class to the line. This is customizable with a theme, but the base color is red.

Usage

import { EditorView } from "@codemirror/view";
import { consoleErrorLine } from "@gdquest/codemirror-console";

const view = new EditorView({
  doc: "Good line\nError line\nGood line",
});

consoleErrorLine(view, 2);

Keywords

gdquest

FAQs

Package last updated on 27 Sep 2023

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.