npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

typescript-openapi-generator

v1.0.1

Published

A typescript only client code generator for Swagger 2.0 and OpenApi 3.0 specifications.

Readme

typescript-openapi-generator

A typescript only client code generator for Swagger 2.0 and OpenApi 3.0 specifications.

Consider this a WIP! I wouldn't use it in production just yet.

However if you have an API specification file that hasn't been correctly parsed please let me know.

This project is inspired by the amazing work that the OpenAPITools devs have done.

However my own experiences with trying to modify the generators was frustrating and overly complex. I wanted to create something that just focused on generating Typescript I could remove a lot of the complexity for scaffolding files.

Installation

You can install the package globally, so it is available anywhere on the command line.

npm install -g typescript-openapi-generator

You can also install as part of your project in the dev dependancies

npm install -D typescript-openapi-generator

Usage

There is a CLI tool that you can use tcg (typescript code gen!)

As an example if it is installed globally you can do

tcg --apiFile your-example-api-spec.yaml

If is installed in your project you can use npx

npx tcg --apiFile your-example-api-spec.yaml

If you don't want to use npx you can add a script into your package.json

scripts: {
    "tcg: "tcg"
}

And it's usage is (note the escaping -- before the arguments):

npm run tcg -- --apiFile your-example-api-spec.yaml

Arguments

There are several parameters in the CLI to use

| | | | -------------------------- | -------------------------------------------------------------------------------------- | | --apiFile | the relative path from the CWD to the api specification file you want to use | | --generator (optional) | which generator to use (default value: 'default') | | --outputDir (optional) | the relative path from the CWD to the output folder (default value: 'code-gen-output') |

You can also run tcg --help to view the help page

Generators

| | | | ----------- | ------------------------------------------------------------------------------------------------ | | default | only creates models, has a index.ts that you can start to use in your code | | angular | creates models, angular services and an api module that you can directly use in your application |