logo
  • 教程列表
  • SO官方文檔
  • 解析命令列引數
    • 傳遞動作(動詞)和值
    • 傳遞布林開關
  1. StackOverflow 文件
  2. Node.js 教程
  3. 解析命令列引數
  4. 傳遞布林開關

傳遞布林開關

Created: November-22, 2018

const options = require("commander");

options
  .option("-v, --verbose")
  .parse(process.argv);

if (options.verbose){
  console.log("Let's make some noise!");
}
  • 傳遞動作(動詞)和值

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明