urai-ecma: Compressing JavaScript and TypeScript Codebases into Token-Efficient Context for Large Language Models

Abstract—Large Language Models (LLMs) are now everydaytools for reading, explaining, and improving source code. Butreal JavaScript and TypeScript projects are large, and sendinga whole codebase to an LLM wastes tokens, costs money, andcan confuse the model, since the parts that matter get buried in boilerplate. This paper presents urai-ecma, a command-line tool written in Rust that turns a JavaScript or TypeScript codebase into a compact, LLM-ready summary. urai-ecmaparses every source file into a full Abstract Syntax Treewith SWC, then walks that tree with a pipeline of visitors:one finds backend API routes, one reads React componentstructure, one keeps or writes short function summaries, andone shortens long Tailwind CSS class names. A local hybridcache remembers past AI-written summaries, so repeat runsare almost instant. We test urai-ecma on six real open-sourcerepositories. Across these repositories it cuts token count by24% to 65%, and by up to 82.7% in a larger real-world casethat motivated the project. Runs that hit the cache finish upto three orders of magnitude faster than the first, cold run.We describe the design, the core algorithms, the benchmarkresults, and the trade-offs, and we suggest directions forfuture work.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-09-15
DOI
https://doi.org/10.5281/zenodo.22774527
Primary Topic
Natural Language Processing Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
preprint

urai-ecma: Compressing JavaScript and TypeScript Codebases into Token-Efficient Context for Large Language Models

Sanjaiyan Parthipan
Zenodo (CERN European Organization for Nuclear Research)
Natural Language Processing Techniques
preprint

urai-ecma: Compressing JavaScript and TypeScript Codebases into Token-Efficient Context for Large Language Models

Sanjaiyan Parthipan
preprint en

Abstract

Abstract—Large Language Models (LLMs) are now everydaytools for reading, explaining, and improving source code. Butreal JavaScript and TypeScript projects are large, and sendinga whole codebase to an LLM wastes tokens, costs money, andcan confuse the model, since the parts that matter get buried in boilerplate. This paper presents urai-ecma, a command-line tool written in Rust that turns a JavaScript or TypeScript codebase into a compact, LLM-ready summary. urai-ecmaparses every source file into a full Abstract Syntax Treewith SWC, then walks that tree with a pipeline of visitors:one finds backend API routes, one reads React componentstructure, one keeps or writes short function summaries, andone shortens long Tailwind CSS class names. A local hybridcache remembers past AI-written summaries, so repeat runsare almost instant. We test urai-ecma on six real open-sourcerepositories. Across these repositories it cuts token count by24% to 65%, and by up to 82.7% in a larger real-world casethat motivated the project. Runs that hit the cache finish upto three orders of magnitude faster than the first, cold run.We describe the design, the core algorithms, the benchmarkresults, and the trade-offs, and we suggest directions forfuture work.

Zenodo (CERN European Organization for Nuclear Research)
Quality Education
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

urai-ecma: Compressing JavaScript and TypeScript Codebases into Token-Efficient Context for Large Language Models — Sanjaiyan Parthipan · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS