code-fns

JSON →
library 0.11.0 ·javascript
verified May 1, 2026

code-fns (v0.11.0) is a JavaScript/TypeScript library for syntax highlighting and code visualization that outputs raw text and hex color tokens instead of HTML/CSS. It is designed for non-web rendering targets such as animations and videos, and is the primary highlighting engine for Motion Canvas. The library supports many languages via tree-sitter grammars, includes a diffing function to compute token-level transformations between code blocks (useful for animations), and ships TypeScript types. It is released on npm with an irregular cadence and requires modern EcmaScript features, so bundling/transpilation is left to the consumer. Key differentiators: output is language-agnostic token arrays, not DOM elements; built-in diff/morph support for transitions; no built-in theming—colors come straight from tree-sitter.

total hits 30
actors 8 distinct systems
last hit 4d ago AhrefsBot
ByteDance
8
Amazonbot
3
MetaBot
3
GPTBot
2
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇩🇪 Germany · 🇫🇷 France · 🇨🇦 Canada