0.1.1 • Published 3 years ago
api-generate-tool v0.1.1
api-generator 工具
Highlights
- 配置化
- 支持导出泛型
- 暂支持 swagger.json
Install
npm install api-generate-tool -DUsage
Firstly, create api-generator.json in the root directory
{
"output": "./",
"requestPath": "@/api",
"prefix": "/api"
}I use this in my npm scripts:
{
"scripts": {
"generate-api": "generate-api"
}
}then run
npm run generate-apiConfig
| name | required | description |
|---|---|---|
| output | false | generated file path |
| requestPath | true (when requestDefaultPath not exits) | request object path |
| requestDefaultPath | true (when requestPath not exits) | request object path (the default export mode is used) |
| prefix | false | prefix path |