{"library":"ts-poet","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"6.12.0","tags":["javascript","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install ts-poet","imports":["import { Code, imp, def } from 'ts-poet';","import { imp } from 'ts-poet';","import { def } from 'ts-poet';","import { conditionalOutput } from 'ts-poet';"]},{"cmd":"yarn add ts-poet","imports":[]},{"cmd":"pnpm add ts-poet","imports":[]}],"homepage":null,"github":"https://github.com/stephenh/ts-poet","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ts-poet","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/ts-poet/compatibility"}}