Skip to content

CodeMirror

A legacy JavaScript code editor for web pages, with over 100 language modes.codemirror/codemirror5

Stars
27.2k
Forks
4.9k
Licence
MIT
Language
JavaScript
Last update
7 months ago
Type
Library

This repository is archived and no longer maintained.

What it is

CodeMirror 5 is a code editor written in JavaScript that runs inside a web browser. It provides syntax highlighting for more than 100 programming languages, plus add-ons for more advanced editing features. Developers add it to their own web applications to give users a code-editing box. The project is archived, and its README points to CodeMirror 6 as the more actively maintained successor.

  • Embed a syntax-highlighted code editor in a web page
  • Choose from over 100 language modes for highlighting
  • Customize the editor's look with its CSS theming system
  • Extend editing behavior using its programming API and add-ons

Great for

  • Developers maintaining an existing site or app that already uses CodeMirror 5
  • Teams that need a browser code editor with many language modes and a theming system
  • Developers who want to read the legacy API while migrating to CodeMirror 6

Not ideal for

  • New projects: the README says CodeMirror 6 is more mobile-friendly, more accessible and actively maintained, and this repository is archived
  • Mobile-first apps, since the README describes CodeMirror 6 as the more mobile-friendly option
  • Non-developers looking for a ready-made text editor app, since this is a library to embed in other software

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js (at least version 6, per the README) · npm

    Install the library from npm

    npm install codemirror@5
  2. 2

    Run it

    • Install the package with npm install codemirror@5
    • Include the library in your web page or bundle
    • Create an editor instance in JavaScript and attach it to a page element
  3. 3

    Get the most out of it

    • Read the manual at codemirror.net/5/doc/manual.html for the full API
    • Use the language modes you need rather than loading all of them
    • Apply CSS themes to match your application's look
    • Ask questions on the discussion forum at discuss.codemirror.net

Downloads

Strengths

  • Large language support, with over 100 language modes according to the README
  • Rich programming API and CSS theming for customization
  • Long history and a large community, with 27,198 GitHub stars

Trade-offs

  • Archived and no longer the actively maintained version, per the README's note about CodeMirror 6
  • The README says cloning the repo will not work for installing without the build step, so the npm package is the intended route

How it compares

ProjectStarsTypeLevelUpdatedBest for
codemirror5 (this)27.2kLibraryintermediate7 months agoDevelopers maintaining an existing site or app that already uses CodeMirror 5
monaco-editor46.9kLibraryintermediate6 days agoWeb developers adding a code editing box to a browser app

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.