Generating Types without climbing a tree [eng]
How do you generate types dynamically? How do you write a script that creates some typescript code? The approach most people would recommend is to use Abstract Syntax Tree manipulations. I was working on a deadline to implement types for our OpenAPI client, and I would have missed our release window. I needed something different and easier to build. Luckily, a friend recommended me a library I didn't know: code-block-writer. I fall in love with it at first sight.
- Co-Founder and CTO of Platformatic.dev
- Member of the Node.js Technical Steering Committee focusing on streams, diagnostics and http
- He is also the author of the fast logger Pino and of the Fastify web framework
- Matteo is an renowed international speaker after more than 60 conferences
- Twitter, LinkedIn, YouTube, Twitch