安装:npm install yargs --save-dev

 

Example

index.js

const argv    = yargs.alias('n', 'name').alias('p', 'port').alias('t', 'tpl').argv
console.log(argv.name);

 

命令行输入: $ node index.js -n fuck -p 8080 -tpl components

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2021-12-05
  • 2022-12-23
  • 2021-10-27
  • 2021-10-10
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案