lang-javascript

JavaScript, TypeScript, and JSX language support for the CodeMirror 6 code editor.

Library
npm
v6.2.5
78stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
34/100Needs Attention
Development Activity12
Maintenance0
Community44
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture85
Code Quality80
Innovation88
Learning Curve80

@codemirror/lang-javascript is the official language package that teaches CodeMirror 6 to understand JavaScript and its close relatives. Built on the Lezer JavaScript parser, it supplies syntax highlighting, context-aware indentation, code folding, and autocompletion for plain JS, TypeScript, JSX, and TSX from a single importable extension.

Drop the javascript() extension into an editor and you get a fully wired language mode: snippet and local-variable completion, JSX auto-closing tags, and an optional bridge to ESLint for inline diagnostics. It is a small, focused dependency that turns a bare CodeMirror instance into a capable JavaScript editing surface.

What You Get

  • A one-call javascript() extension configurable for TypeScript and JSX dialects
  • Standalone language providers: javascriptLanguage, typescriptLanguage, jsxLanguage, and tsxLanguage
  • Snippet and local-variable completion sources, plus scopeCompletionSource for completing from a live scope object
  • autoCloseTags extension that inserts matching JSX closing tags as you type
  • An esLint adapter that connects an ESLint Linter instance to CodeMirror’s lint panel

Common Use Cases

  • Adding a JavaScript or TypeScript editor to a web app, playground, or documentation site
  • Building an in-browser JSX/TSX editing experience with auto-closing tags
  • Wiring inline ESLint diagnostics into a CodeMirror-based code editor
  • Providing context-aware autocompletion for user-authored scripts or config

Under The Hood

Architecture — The core lives in src/javascript.ts, where LRLanguage.define wraps the @lezer/javascript parser and decorates it with indentNodeProp, foldNodeProp, and language-data facets (comment tokens, bracket closing, indent-on-input triggers). Dialect variants (typescriptLanguage, jsxLanguage, tsxLanguage) are produced by .configure() calls that toggle the parser dialect and attach a JSX Sublanguage via sublanguageProp. The public javascript() function in the same file composes the chosen language provider with keyword/snippet completion and, for JSX, the autoCloseTags input handler — a EditorView.inputHandler that resolves the syntax tree at the cursor to decide when to insert </tag> or </>.

Tech Stack — Written entirely in TypeScript (100% of the source) and built with @codemirror/buildhelper. It depends on the CodeMirror 6 module family (@codemirror/language, state, view, autocomplete, lint) as peer-style dependencies and on the Lezer stack (@lezer/common, @lezer/javascript) for parsing. It ships dual ESM/CJS builds with generated type declarations and is marked side-effect-free for tree-shaking.

Code Quality — The codebase is compact and cohesive: four focused source modules (javascript.ts, complete.ts, snippets.ts, eslint.ts) behind a thin index.ts re-export barrel. Tests exist under test/ (test-indent.ts, test-syntax.ts) exercising indentation and syntax behavior via CodeMirror’s test runner. Types are strict and the public surface is documented with /// doc comments that generate the README API reference.

API Design — The developer experience is excellent: the common path is a single javascript({typescript, jsx}) call, while advanced users can reach for the individually exported language providers and completion sources. Naming is consistent and self-describing, every exported symbol carries a documentation comment, and the README shows a complete working example in a few lines. Getting a JavaScript editor running requires almost no boilerplate.

Used by 46 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
Python
54%
Other

authentik

Authentication · Security

24,980

The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.

View details
92
Repo Health
81
Technical
68
Dependency
Built with
Python54%
TypeScript33%
Updated today
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
Ruby
62%
GPL 2.0

Discourse

Community

47,672

Open-source community platform with dynamic trust levels, real-time chat, and a powerful plugin architecture for self-hosted forums.

View details
89
Repo Health
89
Technical
67
Dependency
Built with
Ruby62%
JavaScript31%
Updated today
TypeScript
72%
Other

Epicenter

Knowledge Management · Note Taking · Developer Tools

4,761

A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.

View details
88
Repo Health
90
Technical
68
Dependency
Built with
TypeScript72%
Svelte15%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
JavaScript
51%
MIT

Ghost

CMS · Blogging

54,795

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
69
Dependency
Built with
JavaScript51%
TypeScript43%
Updated today
Rust
69%
Other

GitButler

Developer Tools · Devops · AI Development

21,531

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Rust69%
TypeScript18%
Svelte12%
Updated today
Rust
41%
Other

Hook0

Devops

1,477

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today

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

Search