Parser Building Toolkit for JavaScript
-
Updated
Dec 14, 2025 - TypeScript
A grammar describes the syntax of a programming language, and might be defined in Backus-Naur form (BNF). A lexer performs lexical analysis, turning text into tokens. A parser takes tokens and builds a data structure like an abstract syntax tree (AST). The parser is concerned with context: does the sequence of tokens fit the grammar? A compiler is a combined lexer and parser, built for a specific grammar.
Parser Building Toolkit for JavaScript
Contains source-code for viewers following along with my Beginners Guide To Building Interpreters series on my Youtube Channel.
VSCode extension to highlight nested code blocks
Isomorphic JavaScript/TypeScript Tokenizer for GPT-3 and Codex Models by OpenAI.
A primitive token library used to read from, and to write a node Buffer
Web tool to count LLM tokens (GPT, Claude, Llama, ...)
Play with OpenAI API's using your own API Key. Your API Key is stored and used only from your browser.
📐 Fast token estimation at 94% accuracy of a full tokenizer in a 2kB bundle
ZON → 35-70% cheaper LLM prompts than JSON/TOON. Zero overhead.
n8n node for working with BPE Tokens with GPT in mind.
🐉 JavaScript expression tokenizer and evaluator