Tspoon is a library that provides AST visitors for TypeScript, enabling pluggable modifications to the abstract syntax tree before transpilation. Current stable version is 1.0.460, with active development. It leverages the TypeScript compiler API to allow custom visitors to transform code, perform early optimizations, and bypass diagnostics. Unlike general-purpose AST tools, Tspoon is specifically designed for TypeScript and integrates with its transpilation pipeline. Release cadence is irregular. Key differentiator: deep integration with TypeScript's compiler, supporting visitor composition and custom diagnostics.
npm install tspoonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a visitor that removes private properties and run transpile.
Always explicitly return true/false in filter.
Ensure end > start and use node.getStart() and node.getEnd() correctly.
Pin TypeScript version to one compatible with tspoon (check package peerDependencies).
Avoid using validate() in production; use transpile with custom diagnostics instead.
Run 'npm install tspoon'
Check that traverse() is called with valid visitors and nodes; avoid calling filter on undefined nodes.
Use TypeScript with ESM import: import type { Visitor } from 'tspoon'No dependency data recorded yet.