Reputation: 601
What is the differences of var argv = require("yargs")
and var argv = require("yargs").argv
?
Into variable argv
how the same time that i require a package, there are all functions/modules of package but .argv
what is it?
Thanks all Morris
Upvotes: 0
Views: 1107
Reputation: 2608
require('yargs')
loads the yargs module whih will immediately parse command line options for you. .argv
will contain the options and values the user passes. You could also write it as :
const yargs = require ('yargs')
const argv = yargs.argv
Upvotes: 2