{"library":"code-fns","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"0.11.0","tags":["javascript","syntax","code","ast","highlight","highlighting","typescript"],"last_verified":"Fri May 01","install":[{"cmd":"npm install code-fns","imports":["import { ready } from 'code-fns'","import { language } from 'code-fns'","import { parse } from 'code-fns'"]},{"cmd":"yarn add code-fns","imports":[]},{"cmd":"pnpm add code-fns","imports":[]}],"homepage":null,"github":"https://github.com/Ross-Esmond/code-fns","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/code-fns","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}