acacode / acacode/swagger-typescript-api

add process.exit example of generateApi in README.md

Đang mở
#507 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
4.1k
Fork
436
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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);
});
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.