小编wmr*_*ood的帖子

ES 模块上的 Node.js yargs 包

亚格斯示例:

require('yargs')
  .scriptName("pirate-parser")
  .usage('$0 <cmd> [args]')
  .command('hello [name]', 'welcome ter yargs!', (yargs) => {
    yargs.positional('name', {
      type: 'string',
      default: 'Cambi',
      describe: 'the name to say hello to'
    })
  }, function (argv) {
    console.log('hello', argv.name, 'welcome to yargs!')
  })
  .help()
  .argv
Run Code Online (Sandbox Code Playgroud)

我该如何在 ESM 中执行此操作?

提前致谢

node.js yargs es6-modules

2
推荐指数
1
解决办法
2635
查看次数

标签 统计

es6-modules ×1

node.js ×1

yargs ×1