ob-ts-node
Org Babel support for TypeScript via ts-node
Developed a comprehensive solution for Literate TypeScript Programming in Emacs. It leverages ts-node to provide first-class support for modern TypeScript (imports, types) within Org-Mode code blocks, and optionally supports other runtimes like Deno, Bun, or npx via the :cli-cmd parameter.
Usage Example
typescript
interface User {
name: string;
id: number;
}
const user: User = { name: "Alice", id: 1 };
console.log(`${user.name}:${user.id}`);
Key Details
- Literate Programming
- Enables direct execution of TypeScript code blocks within Org docs, bridging the gap between documentation and runnable code.
- Modern Tooling
- Built on top of ts-node, allowing support for modern ES features, CommonJS imports, and complex
tsconfig.jsonconfigurations. - Ecosystem Adoption
- Widely adopted by the Emacs community as the recommended solution for TypeScript in Org Babel, replacing deprecated wrappers.