I found a solution for it, hope this is helpful for whoever needs
Create a text file say Input.txt - This will have all the answers for the questions asked
Command while npm install should be
npm install <
Ex: npm install < Input.txt
When ever there is any question in cmd, it will take the corresponding values from the text file
Please note: Extra enter at the end of the file needs to be there