@codemirror/language-data

Language metadata and dynamic loading for every language mode in the CodeMirror 6 editor

Library
npm
v6.5.2
13 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
25 /100 Needs Attention
Development Activity 8
Maintenance 0
Community 20
Maturity 60
Momentum 12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
68 /100 Good
Architecture 75
Code Quality 70
Innovation 60
Learning Curve 65

@codemirror/language-data is the language registry for CodeMirror 6. Rather than bundling every language package into your editor, it exposes a single languages array of LanguageDescription objects, one per supported language, each carrying filename/extension matchers and a dynamic import() loader for that language’s actual mode package. This lets an editor offer language auto-detection and a full language picker while only downloading the parser code a user actually needs.

What You Get

  • A languages array of LanguageDescription entries covering ~40 languages, ready to feed into a language-picker UI
  • LanguageDescription.matchFilename and matchLanguageName helpers for auto-detecting a language from a file path or name
  • Dynamic import()-based lazy loading so unused language packages never ship to the browser
  • A single dependency surface that transitively pulls in the full set of official @codemirror/lang-* packages for convenience installs

Common Use Cases

  • Building a browser-based code editor (like an in-browser IDE or playground) that needs to auto-detect a file’s language from its extension
  • Populating a ‘change language’ dropdown in a CodeMirror-based editor without manually importing every language package
  • Loading syntax highlighting and language support on demand to keep initial bundle size small in a documentation or notebook tool
  • Powering multi-language snippet or gist editors where the language isn’t known until runtime

Under The Hood

Architecture The entire package is a single 1,000-line file, src/language-data.ts, that constructs one flat languages array of LanguageDescription.of({...}) calls, each entry pairing a name, filename/extension regex, optional MIME/alias list, and a load function that returns import('@codemirror/lang-x'). There is no runtime logic beyond this declarative table plus the LanguageDescription class it re-exports from @codemirror/language; matching (matchFilename, matchLanguageName) is delegated entirely to that upstream class. Tech Stack Written in TypeScript, built with CodeMirror’s shared @codemirror/buildhelper tool, and shipped as both ESM (dist/index.js) and CJS (dist/index.cjs) with bundled .d.ts types. Its dependencies list every official @codemirror/lang-* package (JSON, Python, Rust, SQL, YAML, etc.) plus @codemirror/legacy-modes, but none of them are imported eagerly — they only load through the dynamic import() inside each entry’s load function. Code Quality There are no dedicated unit tests in this repository; correctness is exercised indirectly via CodeMirror’s shared cm-runtests harness used across the monorepo-like family of @codemirror/* packages. The single source file is consistent and readable — one repeated object-literal pattern per language — which keeps the risk surface low despite the absence of local tests. API Design The public surface is minimal and ergonomic: import languages and call LanguageDescription.matchFilename(languages, filename) to get a matching description, then .load() to lazily fetch the actual language support. No configuration objects, no build-step wiring, and no boilerplate beyond that one call — the tradeoff is that customizing the language list (adding a custom language) means constructing your own LanguageDescription array rather than extending this one.

Used by 12 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
Go
61%
Apache 2.0

Apache Answer

Community

15,683

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
90
Repo Health
78
Technical
68
Dependency
Built with
Go 61%
TypeScript 36%
Updated 1 weeks ago
Go
83%
MIT

Gitea

Developer Tools · Devops · Project Management

58,194

Self-hosted DevOps in a single Go binary — Git hosting, GitHub Actions-compatible CI/CD, and 30+ package registries without any SaaS dependency.

View details
93
Repo Health
79
Technical
64
Dependency
Built with
Go 83%
Updated 5 days ago
Go
62%
Apache 2.0

Harness Open Source

Code Editors · Developer Tools · Devops

38,450

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
89
Repo Health
79
Technical
64
Dependency
Built with
Go 62%
TypeScript 33%
Updated 1 weeks ago
TypeScript
77%
Other

Joplin

Note Taking

56,513

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 6 days ago
Go
42%
AGPL 3.0

listmonk

Blogging · Marketing

23,600

High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.

View details
83
Repo Health
74
Technical
67
Dependency
Built with
Go 42%
Vue 24%
JavaScript 19%
Updated 1 weeks ago
Python
62%
Apache 2.0

marimo

Data Engineering · Developer Tools

22,918

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
89
Repo Health
91
Technical
65
Dependency
Built with
Python 62%
TypeScript 37%
Updated 6 days ago
TypeScript
80%
AGPL 3.0

massCode

Code Editors · Developer Tools · Productivity

7,003

A free, local-first developer workspace unifying snippets, notes, HTTP requests, calculations, drawings, and dev tools in one desktop app.

View details
87
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 80%
Vue 19%
Updated 6 days ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python 37%
Svelte 34%
JavaScript 21%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers