UNPKG

ts-from-swagger

Version:

Generate TypeScript interfaces and enums quickly and easily from Swagger definition JSON with our lightweight tool. Improve your development workflow by automatically generating type-safe code that's easy to maintain and understand. Say goodbye to manual

6 lines (5 loc) 257 B
import {generateInterfaces} from "./utils.js" const args = process.argv.slice(2); const swaggerUrl = args[0] || "https://petstore.swagger.io/v2/swagger.json"; const outputDir = args[1] || "./src/definitions"; generateInterfaces(swaggerUrl, outputDir);