@kubb/parser-ts
This library contains the building blocks that can be used to create TypeScript code. All of this is based on the TypeScript AST engine. A good tool to visualize what AST is can be found on TypeScript AST Viewer, here you can visualize the AST based on some TypeScript code.
To get started with TypeScript AST, I would suggest following this tutorial: Generating TypeScript using AST's.
Installation
shell
bun add -d @kubb/parser-ts
shell
pnpm add -D @kubb/parser-ts
shell
npm install --save-dev @kubb/parser-ts
shell
yarn add -D @kubb/parser-ts
API
print
: Convert AST TypeScript nodes to a string based on the TypeScript printer.format
: Format the generated code based on the TypeScript printer.