using this variable, we can grab the all vars and flags passed to the current process.
in this example, we will create a function to grab a specific flag when passed to a process.
when passed to a process means that you specify the flag when calling node filename -flag flagValue
// grab content of a specific flagconstgrab=(flag)=>{letindexAfterFlag=process.argv.indexOf(flag)+1;// calculate the indexAfterFlagreturnprocess.argv[indexAfterFlag];};// in our fileconstmyFlagContent1=grab("-flag1");// grab content of `-flag1`constmyFlagContent2=grab("--flag2");console.log(myFlagContent1,myFlagContent2);