TypeScript Poet

JSON →
library 6.12.0 ·javascript
verified May 27, 2026

ts-poet is a specialized code generation DSL (Domain Specific Language) for TypeScript, currently at version 6.12.0. It distinguishes itself by leveraging TypeScript's template literals to provide an intuitive, string-based approach to code generation, sidestepping the complexities of direct Abstract Syntax Tree (AST) manipulation. Its core strength lies in automatic import management, intelligently collecting and emitting necessary `import` statements, resolving symbol collisions, and simplifying conditional output. ts-poet also integrates `dprint-node` for fast and 'prettier-ish' code formatting, a significant differentiator from many generators that output unformatted or poorly formatted code. While inspired by JavaPoet's builder patterns in its earlier v1/v2 releases, the library has since evolved to a more streamlined, template-literal-centric API, making it highly adaptable for generating code from arbitrary schemas or user-defined inputs. The project maintains an active development status with consistent updates to support modern TypeScript features and ecosystem changes.

total hits 12
actors 5 distinct systems
last hit 4d ago AhrefsBot
GPTBot
5
Script
1
Search engines
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany