CLI tool for generating and testing Tree-sitter parsers, version 0.26.8. Released as part of the tree-sitter project, which provides a fast incremental parser framework. The CLI supports generating parser C code from grammar files, testing parsers, and building WASM modules. Key differentiators include high performance, incremental parsing with error recovery, and support for multiple languages via grammar definitions. Release cadence is frequent with minor bug fixes and improvements.
npm install tree-sitter-cliVerified import paths — ran on the pinned version, not inferred.
Parse JavaScript source code using tree-sitter and print the syntax tree.
Update grammar files to new format (see migration guide)
Use 'web-tree-sitter' for browser or Node ESM
Use --ranges or remove flag
npm install tree-sitter
Use: const Parser = require('tree-sitter');Ensure language module is correctly loaded (e.g., require('tree-sitter-javascript'))