@nowak-ds/api-type-formatter
v1.0.7
Published
This module can convert an API JSON description into TypeScript typings.
Downloads
8
Readme
API type formatter
This module can convert an API JSON description into TypeScript typings.
Installation
npm i @nowak-ds/api-type-formatter
Configuration
Create file called convert-config.json in your porjects root directory. The file should look like this.
{
"targetDir": "src/types",
"src": [
{
"url": "http://localhost:3000/api",
"name": "Api1"
},
{
"url": "http://localhost:3000/api2",
"name": "Api2"
}
]
}
Execute
Simply call:
node node_modules/@nowak-ds/api-type-formatter/index.js
Or create a new script in your package.json file:
"scripts": {
"update-types": "node node_modules/@nowak-ds/api-type-formatter/index.js"
}