Back to browse
Weekend Project, Built a Vanilla JavaScript Online Code Editor (2022)

Weekend Project, Built a Vanilla JavaScript Online Code Editor (2022)

by coevcan·Mar 22, 2026·2 points·0 comments

AI Analysis

MidCozyBig Brain

Vanilla JS editor with regex loop prevention, but CodePen already owns this.

Strengths
  • Regex injection prevents infinite loops without requiring heavy sandboxing infrastructure.
  • Overlapping DOM elements enable syntax highlighting without external libraries.
  • Code sharing via URL hash requires no backend storage.
Weaknesses
  • Multi-browser support remains untested and nesting highlighting is broken.
  • sessionStorage auto-save loses data across machines or when cleared.
Target Audience

Developers learning editor internals

Similar To

CodePen · JSFiddle · Replit

Post Description

(original write-up from late 2022, never shared it, pre vibe coding)

Over the weekend I wanted to understand how code editors work under the hood, so I built a lightweight, standalone online JavaScript editor using only HTML, CSS, and vanilla JavaScript—no libraries, no frameworks, no plugins.

Live demo: https://editor.codeeverywhere.ca Github: https://github.com/codeeverywhereca/codeeditor

Fully open source - MIT License

Similar Projects

A TUI text editor built by FTXUI

Pretty terminal editor with standard keybinds, but Micro and Helix already own this niche.

CozyShip It
Frameser
113mo ago