UNPKG

@tcatche/swagger-ts

Version:

Codegen from swagger to TS & Axios Functions

9 lines (7 loc) 275 B
const fs = require('fs') const path = require('path') const swagger2ts = require('../index') const json = require('./origin.json') swagger2ts.generate(json).then(codeResult => { fs.writeFileSync(path.join(__dirname, `result.ts`), codeResult) }).catch(console.log)