UNPKG
@tcatche/swagger-ts
Version:
latest (1.0.6)
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
Codegen from swagger to TS & Axios Functions
github.com/tcatche/swagger-ts
tcatche/swagger-ts
@tcatche/swagger-ts
/
test
/
debug copy.js
9 lines
(7 loc)
•
275 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
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
)