orga.js
ORGAJS(3)orga.jsORGAJS(3)

NAME

orgajsJavaScript parser for org-mode, producing ASTs compatible with the unified ecosystem

SYNOPSIS

status: active

tags: library, javascript

repo: https://github.com/orgapp/orgajs

Overview

orga parses org-mode files into Abstract Syntax Trees in JavaScript. It follows unified.js conventions, so the AST plugs directly into the broader content processing ecosystem—remark, rehype, retext, and the plugins built around them.

The original motivation: org-mode is the main reason I learned Emacs. It's a genuinely better format for structured writing and code documentation. But it's locked inside Emacs. If you want to render org content in a web application, you historically needed Emacs in your build pipeline, which is absurd. Orga reimplements the parser in JavaScript so the content can go anywhere JavaScript runs.

How It Works

Parsing produces an oast (org AST) tree. From there, unified plugins transform or render it:

import { unified } from 'unified'
import parse from '@orgajs/reorg-parse'
import stringify from '@orgajs/reorg-rehype'
import html from 'rehype-stringify'

const result = await unified()
  .use(parse)
  .use(stringify)
  .use(html)
  .process(orgContent)

The parser handles the structural features you actually use: headlines with properties and tags, inline markup, lists, tables, source blocks, and drawer syntax. It also supports #+begin_export jsx blocks, which lets you embed React components directly in org files—useful for sites built with Next.js or similar.

Features

Beyond the core parser, the project has grown into a broader toolchain. The monorepo contains the full package list, but the major pieces:

orga-build — a static site generator built on top of Vite. Org files are first-class pages; React/TSX files handle layouts and custom pages. This site is built with it.

Vite/Rollup/esbuild integration — org files can be imported directly in JavaScript bundles. The build tooling handles parsing and transformation as part of the normal module graph.

JSX in org files#+begin_export jsx blocks let you embed React components inline in org content. The parser passes these through; the build layer handles rendering.

CodeMirror integration — syntax highlighting and editing support for org-mode in the browser, useful for any editor built on CodeMirror.

AUTHOR

Xiaoxing Hu

orga.js2026-02-15Active