commander-js/extra-typings commander 类型安全的玩法
commander-js/extra-typings 提供了类型推理能力,可以进行强类型的cli 命令开发,不少cli 应用都是用了此包
参考玩法
- app.ts
import { program } from '@commander-js/extra-typings';
program.command('print')
.argument('<file>')
.option('--double-sided')
.action((targetFile, options) => {
// command-arguments and options are fully typed
});
说明
希望进行强类型commander cli 开发的(基于ts 的),commander-js/extra-typings 是一个值得使用的包
浙公网安备 33010602011771号