Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var argv = require("yargs")和有什么区别var argv = require("yargs").argv?进入变量argv的同时,我需要一个包,有包的所有功能/模块,但.argv它是什么?
var argv = require("yargs")
var argv = require("yargs").argv
argv
.argv
谢谢所有的莫里斯
require('yargs')加载 yargs 模块,它将立即为您解析命令行选项。.argv将包含用户传递的选项和值。你也可以把它写成:
require('yargs')
const yargs = require ('yargs') const argv = yargs.argv