jsx-notation
v0.1.6JSXN encoder/decoder — compact notation for React/Next.js files, optimized for LLMs
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
read_jsxn Read file as JSXN
Reads a React/Next.js file (.jsx, .tsx, .js, .ts), HTML file (.html), or SVG file (.svg) from disk and returns its JSXN-compressed representation (~40% fewer tokens). Use this instead of reading JSX/TSX files directly when you need to understand component structure, props, and rendering logic. For full files with imports/hooks/logic, the file-level encoding is used automatically. For .html and .svg files, the HTML encoder is used.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or relative path to the .jsx/.tsx/.js/.ts/.html/.svg file to encode |
encode_jsxn Encode code to JSXN
Encodes raw JSX/TSX source code or HTML into JSXN compact notation (~40% fewer tokens). Use "snippet" mode for JSX fragments (just the template). Use "file" mode for complete React/Next.js files with imports, types, hooks, etc. Use format "html" to encode HTML source.
| Parameter | Type | Description |
|---|---|---|
code * | string | The JSX/TSX/HTML source code to encode |
format | string | "jsx" for JSX/TSX (default), "html" for HTML source |
mode | string | "file" for complete files with imports/hooks/logic, "snippet" for JSX-only fragments |
decode_jsxn Decode JSXN to code
Decodes JSXN compact notation back into standard JSX/TSX or HTML source code. Use "snippet" mode for JSXN body fragments (just the template). Use "file" mode for complete JSXN files with imports, types, hooks, etc. Use format "html" to decode to HTML output.
| Parameter | Type | Description |
|---|---|---|
code * | string | The JSXN notation to decode |
format | string | "jsx" for JSX/TSX (default), "html" for HTML output |
mode | string | "file" for complete files with imports/hooks/logic, "snippet" for JSXN body fragments |
write_jsxn Write JSXN as file
Decodes JSXN notation and writes the resulting JSX/TSX or HTML to a file on disk. Creates parent directories if needed. Writes to .jsx/.tsx/.js/.ts/.html/.svg files. For .html and .svg files, decodes with HTML format (class attrs, void elements, SVG self-closing, etc.). ## JSXN Format Reference JSXN is a compact notation for React/Next.js code that saves ~40% tokens. ### File-level headers - `@I module: default Name, x, y` → `import Name, { x, y } from "module"` - `@I "styles.css"` → `import "styles.css"` - `@T module: Type1` → `import type { Type1 } from "module"` ### Directives - `…
| Parameter | Type | Description |
|---|---|---|
code * | string | The JSXN notation to decode and write |
path * | string | Target file path (.jsx, .tsx, .js, .ts, .html, or .svg) |