New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gcode-lang-codemirror

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gcode-lang-codemirror

G-Code Language Support for CodeMirror 6

latest
Source
npmnpm
Version
0.2.4
Version published
Maintainers
1
Created
Source

gcode-lang-codemirror

G-Code Language Support for CodeMirror 6

Overview

  • Features
  • Installation
  • Usage
  • License

Features

This support language includes syntax highlighting for the G-Code language.

There is also support for tooltip hovering so when a command is hovered over a description of what that command does will be displayed.

Installation

gcode-lang-codemirror is available through the npm registry:

$ npm install gcode-lang-codemirror

Usage

Example usage with a basic editor and G-Code language suport

editor.js
// Import codemirror aspects
import { EditorState, EditorView, basicSetup } from '@codemirror/basic-setup';

// Import the language
import { GCodeLanguage } from 'gcode-lang-codemirror';

// Create the editor state pre-filled with some G-Code
let state = EditorState.create({
  doc: 'G1 X30.00 Y90\nG90\nG0', 
  extensions: [
    basicSetup,
    GCodeLanguage(),
  ]
});

// Create the editor view and bind to the element in the DOM
const view = new EditorView({
  state, 
  parent: document.querySelector('#editor')
});

License

MIT

Copyright (c) 2021-present, OneIsland Limited

Keywords

gcode

FAQs

Package last updated on 27 Apr 2022

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