process.argv

 it is a special property of process

It returns an array containing the command line arguments passed when the Node.js process was launched

when printed without any argument console.log(process.argv) it only prints two lines
1.Executable path for node
2.file's location
when sent with parameters it also prints the parameters

// console.log(process.argv);

let args = process.argv;

for (let i = 2; i < args.length; i++) {
  console.log("helloo", args[i]);
}






Comments

Popular posts from this blog

DATABASE RELATIONSHIPS

ROUTING (GET /) home route

Query Strings