Skip to content

@kubb/parser 🦙 ​

This library contains the building blocks that can be used to create TypeScript code. It's all based on TypeScript AST(an API of the TypeScript team to create AST nodes).

A good tool to visualize what AST is can be found on TypeScript AST Viewer, here you can see what the AST code would be based on some TypeScript code.

To get started with TypeScript AST, I would suggest following this tutorial: Generating TypeScript using AST's.


This library contains also the logic to print the nodes(convert AST to string) and it also has the functionality to generate index.ts files based on a folder structure(see writeIndexes).

Installation ​

shell
bun add @kubb/parser
bun add @kubb/parser
shell
pnpm add @kubb/parser
pnpm add @kubb/parser
shell
npm install @kubb/parser
npm install @kubb/parser
shell
yarn add @kubb/parser
yarn add @kubb/parser

Released under the MIT License.