import * as fs from "fs" ; import { CodeGenerator } from "@himenon/openapi-typescript-code-generator" ; const main = ( ) => { const codeGenerator = new CodeGenerator ( "your/openapi/spec.yml" ) ; const code = codeGenerator . generateTypeDefinition ( ) ; fs . writeFileSync ( "client.ts" , code , { encoding : "utf-8" } ) ; } ; main ( ) ;