Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@editora/light-code-editor

Latest version: v1.2.1

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: ajaykr089
3 Stars
0 Forks
8 Versions
620 Downloads
TypeScript Repo language

Scan summary

@editora/light-code-editor was last scanned on 29 Nov 2026 at version 1.2.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 8 versions; the latest 2 were published within 5 days (25–29 Nov 2026).
  • Findings: No rules fired in version 1.2.1.
  • Downloads: 620 downloads.

Versions

8 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.2.1 LATEST 29 Nov 2026 No rules fired
1.2.0 25 Nov 2026 No rules fired
1.1.0 22 Oct 2026 No rules fired
1.0.18 13 Oct 2026 Not shown
1.0.17 8 Oct 2026 Not shown

No rules fired in 1.2.1

Findings

Findings for v1.2.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.2.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Features

  • Extensions, not a monolith. Line numbers, highlighting, search, diagnostics, completions, formatting, folding and the rest are extensions you add, so you ship only what you use.
  • Syntax highlighting for more than twenty languages, switched at run time.
  • Search and replace with case, whole-word and regular-expression modes.
  • Diagnostics, completions and code actions that you feed from your own language service, including async ones that are cancelled when they go stale.
  • Formatting, comments and line commands: format the document or the selection, toggle comments, duplicate and move lines, go to a line.
  • Folding, bracket matching, indent guides and an active-line highlight.
  • Decorations: tint lines, put badges in the gutter and mark ranges of text, without rewriting the text DOM.
  • Light and dark themes, a read-only mode, and a keymap you can change.
  • Accessible by default. The editing surface is a named multi-line text box; the completion list is a combobox listbox (aria-activedescendant, a live status line); find, go to line and the menus are named and keyboard operable; text keeps 4.5:1 in both themes. Checked with axe in Chromium, Firefox and WebKit.
  • Written in TypeScript, no dependencies. Checked in current Chromium, Firefox and WebKit.

Install

npm install @editora/light-code-editor

Quick start

import {
  ActiveLineAndIndentGuidesExtension,
  BracketMatchingExtension,
  CodeFoldingExtension,
  CompletionExtension,
  ContextMenuExtension,
  DiagnosticsExtension,
  EditingCommandsExtension,
  FormattingExtension,
  LineNumbersExtension,
  SearchExtension,
  SyntaxHighlightingExtension,
  createEditor,
} from '@editora/light-code-editor';
import '@editora/light-code-editor/light-code-editor.css';

const container = document.getElementById('editor');

if (!container) {
  throw new Error('Missing #editor container');
}

const editor = createEditor(container, {
  value: `interface User {
  id: number;
  name: string;
}

function greet(user: User): string {
  if (!user.name) {
    return 'Hello, stranger';
  }

  return \`Hello, \${user.name}\`;
}

console.log(greet({ id: 1, name: 'Ada' }));
`,
  theme: 'dark',
  tabSize: 2,
  lineNumbers: true,
  extensions: [
    new LineNumbersExtension(),
    new SyntaxHighlightingExtension(),
    new SearchExtension(),
    new DiagnosticsExtension(),
    new CompletionExtension(),
    new FormattingExtension(),
    new ContextMenuExtension(),
    new EditingCommandsExtension(),
    new ActiveLineAndIndentGuidesExtension(),
    new BracketMatchingExtension(),
    new CodeFoldingExtension(),
  ],
});

editor.executeCommand('setSyntaxLanguage', 'typescript');

editor.on('change', (changes) => {
  console.log('Content changed:', changes);
});

The editor is at least 400 px tall; give the container a height, as in the React example below, to size it, and the editor scrolls inside it. Import the stylesheet once; it styles the gutter, the popups, the panels and the decorations. Call editor.destroy() when you are done with the editor.

Use it in React

There is no React wrapper to learn: create the editor in an effect and destroy it in the cleanup.

import { useEffect, useRef, useState } from 'react';
import {
  LineNumbersExtension,
  SearchExtension,
  SyntaxHighlightingExtension,
  createEditor,
  type EditorAPI,
} from '@editora/light-code-editor';
import '@editora/light-code-editor/light-code-editor.css';

type CodeEditorProps = { value: string; onChange: (value: string) => void; language?: string };

export function CodeEditor({ value, onChange, language = 'json' }: CodeEditorProps) {
  const container = useRef<HTMLDivElement>(null);
  const editor = useRef<EditorAPI | null>(null);
  const latestOnChange = useRef(onChange);
  latestOnChange.current = onChange;

  // Create the editor once, and destroy it when the component goes away.
  useEffect(() => {
    const instance = createEditor(container.current as HTMLElement, {
      value,
      lineNumbers: true,
      extensions: [new LineNumbersExtension(), new SyntaxHighlightingExtension(), new SearchExtension()],
    });
    instance.executeCommand('setSyntaxLanguage', language);
    instance.on('change', () => latestOnChange.current(instance.getValue()));
    editor.current = instance;
    return () => instance.destroy();
  }, []);

  // Copy a value that changed outside the editor into it, but not the editor's own edits.
  useEffect(() => {
    if (editor.current && editor.current.getValue() !== value) editor.current.setValue(value);
  }, [value]);

  return <div ref={container} style={{ height: 180 }} />;
}

export default function App() {
  const [config, setConfig] = useState('{\n  "name": "my-app",\n  "private": true\n}\n');

  return (
    <>
      <CodeEditor value={config} onChange={setConfig} />
      <p>{config.length} characters</p>
      <button onClick={() => setConfig('{}\n')}>Reset</button>
    </>
  );
}

This works in React's StrictMode, which runs effects twice in development.

Languages

Set the language with editor.executeCommand('setSyntaxLanguage', id), or syntax.registerMode(id, mode) to add your own. The default is html.

Language Ids
HTML, CSS, XML html, css, xml, svg
JavaScript, TypeScript javascript js, jsx, typescript ts, tsx
JSON, YAML, Markdown json, yaml yml, markdown md
Shell bash shell sh zsh
Python, Ruby, PHP python py, ruby rb, php
Go, Rust, C, C++ go golang, rust rs, c, cpp c++ cc cxx
Java, C# java, csharp cs
SQL, Dockerfile sql, dockerfile docker
Templates vue, ejs

Options

createEditor(container, {
  value: '',             // the starting text
  ariaLabel: 'Code editor', // what a screen reader calls the editing surface; name it for what it edits
  theme: 'light',        // 'light' or 'dark'; change it later with setTheme()
  readOnly: false,
  tabSize: 2,            // how wide a tab is drawn
  lineWrapping: false,   // wrap long lines instead of scrolling sideways
  lineNumbers: true,     // the gutter; toggle it later with the toggleLineNumbers command
  autoIndent: true,      // Enter keeps the line's indentation (one level more after {, [ or ( )
  extensions: [],        // see Extensions below
  keymap: {},            // your own shortcuts, for the default keymap
});

The editor API

createEditor returns an editor with these methods:

Method
getValue() / setValue(text) Read or replace the text. setValue is one undo step.
getCursor() / setCursor(position) The caret; a position is { line, column }, both starting at 0.
getSelection() / setSelection(range) The selected range, { start, end }, or undefined.
setTheme(name) / setReadOnly(boolean) Change the theme or the read-only mode.
executeCommand(name, ...args) Run a command (see Extensions).
registerCommand(name, handler) Add a command.
addExtension(ext) / removeExtension(name) Add or remove an extension later.
search(query, options?) / replace(range, text) / replaceAll(query, text, options?) Search and edit by code.
fold(range) / unfold(range) / getFolds() Folding.
setDecorations(layer, list) / clearDecorations(layer?) / getDecorations(layer?) Decorations.
focus() / blur() / destroy() Focus, blur, and tear the editor down.
on(event, handler) / off(event, handler) Events.
Event Handler receives
change The list of text changes.
cursor The cursor.
selection The selected range, or undefined.
focus, blur Nothing.
keydown, mousedown, contextmenu The DOM event.
save Nothing: Cmd/Ctrl+S was pressed.

Extensions

Pass extensions in extensions. Each one adds commands, which you run with editor.executeCommand(name). The common ones are also bound to keys.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @editora/light-code-editor

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229