当我使用yargs模块来简化参数处理时
Yargs总是将params作为对象重新运行,这里是一个示例,如果我运行node index.js default --optipn1=true --option2=false --custom
命令
Yarg返回此数组:
{
_: [ 'default' ],
optipn1: 'true',
option2: 'false',
custom: true,
'$0': 'index.js'
}
我需要的是相同的参数数组,除了_
和$0
{
optipn1: 'true',
option2: 'false',
custom: true,
}
有办法做那件事吗?
是否有任何内置功能可以实现这一点?
3条答案
按热度按时间h43kikqp1#
开始了我希望对你有用
jucafojl2#
o7jaxewo3#
Javascript语言
typescript