The following code is from the Node.js course I am following:
var args = require("minimist")(process.argv.slice(2), { string: "name"});
I understand that a module is being imported, but I don't understand the second set of parentheses after the require()
call:
require("minimist")(this part I don't understand)
Specifically, what is the second set of parentheses in terms of syntax?
I know how slice()
works, and I understand that string: "name"
creates a command line argument to check for, but what method is being called through the require()
call, and how?
PS: The course (by Kyle Simpson) indicates that the above syntax will be explained later, but I haven't been able to locate the specific part, and I don't like to proceed without understanding something. I am new to both JS and Node.js.