Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问如何通过脚本实现 将types中的d.ts文件全转换成json文件? #1

Open
yc199609 opened this issue Apr 3, 2020 · 1 comment

Comments

@yc199609
Copy link

yc199609 commented Apr 3, 2020

请问如何通过脚本实现 将types中的d.ts文件全转换成json文件?
我尝试在package.json中 配置脚本
"json": "cross-env typescript-json-schema src/types/.d.ts '' -o src/jjj/*.json --id=api --required --strictNullChecks"
这样会报错 throw new Error("Unable to write output file: " + err.message);
求大佬指点

@SunshowerC
Copy link
Owner

typescript-json-schema 这个工具本身好像不支持批量转换,所以你得要用 find 过滤出 d.ts 文件,再通过管道用 xargs 对每一个 d.ts 执行 typescript-json-schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants