acacode / acacode/swagger-typescript-api

add process.exit example of generateApi in README.md

未关闭
#507 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
4.1k
派生
436
PR 合并指标
30 天内没有已合并 PR

描述

Hi, thanks for this project, it makes life simpler.

But I hava a small recommendation that, it will be useful to add `process.exit` example of generateApi in README.md.
Since I would like to make a watch dog cli to detect changes of swagger.json and auto generate client.ts when swagger.json changes.
I found out that my program can not exit in expected.

And I found some similar case in https://github.com/acacode/swagger-typescript-api/pull/436
After adding `process.exit`, the hanging situation is resolved.
So my code finally looks like this.
```
generateApi(myConfig)
.catch((error) => {
console.error(error);
process.exit(1);
})
.finally(() => {
process.exit(0);
});
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。